<script src="~/Scripts/angular.min.js"></script> <script src="@Url.Content("~/Scripts/ej.web.all.min.js")"></script> <script src="~/Scripts/ej.widget.angular.min.js"></script> |
<script> . . . angular.module('listCtrl', ['ejangular']) .controller('GridCtrl', function ($scope) { . . . }); </script> |
<div ng-controller="GridCtrl"> <div id="grid" ej-grid e-datasource="data" e-pagesettings-pagesize="15" e-pagesettings-currentpage="1" e-pagesettings-pagecount="6" e-allowpaging="true" e-allowSorting="true"> <div e-columns> <div e-column e-field="OrderID" e-headertext="Order ID" e-isprimarykey="true" e-textalign="right" div> . . . </div> |
http://docs.syncfusion.com/js/angularjs
<div ng-controller="GridCtrl"> <div id="grid" ej-grid e-datasource="data" e-toolbarclick="toolbarHandler" e-toolbarsettings-toolbaritems='toolbar' e-toolbarsettings-showtoolbar='true' > </div> </div>
angular.module('listCtrl', ['ejangular']) .controller('GridCtrl', function ($scope) { $scope.toolbar = ["add", "edit", "delete", "cancel","excelExport", "pdfExport","wordExport"]; $scope.data = dm; $scope.toolbarHandler = function (args) { if (args.itemName == "Excel Export") { args.cancel = true; this.export("/Home/ExportToExcel"); } . . . } public class HomeController : Controller public void ExportToExcel(string GridModel) { ExcelExport exp = new ExcelExport(); IEnumerable < Order > DataSource = new DataClasses1DataContext().Orders.ToList(); var obj = ConvertGridObject(GridModel); exp.Export(obj, DataSource, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron"); |
<div ng-controller="GridCtrl"> <div id="grid" ej-grid e-datasource="data" e-toolbarclick="toolbarHandler" e-toolbarsettings-showtoolbar='true' e-toolbarsettings-toolbaritems='toolbar' e-editsettings-editmode="dialog" e-editsettings-showdeleteconfirmdialog="true"> </div> </div> |
<div ng-controller="GridCtrl"> <div id="grid" ej-grid e-datasource="data" e-toolbarclick="toolbarHandler" e-toolbarsettings-showtoolbar='true' e-toolbarsettings-toolbaritems='toolbar' e-editsettings-editmode="dialog" e-editsettings-showdeleteconfirmdialog="true"> </div> </div> |
<div ng-controller="GridCtrl"> <div id="grid" ej-grid e-datasource="data" . . . e-allowfiltering="true" e-filtersettings-filtertype="menu" </div> |