BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
[View] <div id="Grid" data-bind="ejGrid: {dataSource: dataSource, columns: col,showSummary: true,allowGrouping:true,summaryRows:summaryRows}"></div> <script src="~/Scripts/jsondata.min.js"></script> <script type="text/javascript"> $(function () { window.orderView = { dataSource: ej.DataManager({ url: '/Grid/DataSource', adaptor: "UrlAdaptor" }), col: [{ field: 'OrderID', headertext: 'Order ID', width: '75', textalign: ej.TextAlign.Right }, . . . ],
summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }], showTotalSummary: true }], }; ko.applyBindings(orderView); });
|
[Ctrl] public partial class GridController: Controller { . . . public ActionResult DataSource(DataManager dm) {
IEnumerable DataSource = OrderRepository.GetAllRecords(); DataOperations ds = new DataOperations(); DataResult result = new DataResult(); List<string> str = new List<string>(); if (dm.Aggregates != null) { for (var i = 0; i < dm.Aggregates.Count; i++) str.Add(dm.Aggregates[i].Field); result.aggregate = ds.PerformSelect(DataSource, str); } DataSource = ds.PerformSkip(DataSource, dm.Skip); result.result = ds.PerformTake(DataSource, dm.Take); result.count = DataSource.AsQueryable().Count(); return Json(result, JsonRequestBehavior.AllowGet); } . . . |
var obj = $("#Grid").ejGrid("instance") obj.model.dataSource; // instance of dataManager obj.model.currentViewData; //retreives the currentPage's data alone |