BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<select id="Data" class="e-ddl" data-bind="value: field"> <option value="Orders" selected="selected">Orders</option> <option value="Order_Details">OrderDetails</option> </select>
$("#Data").ejDropDownList({ width: "115", selectedItemIndex: 0, select: function (args) {
var data = ej.DataManager({ url: args.value == "Order_Details" ? "http://mvc.syncfusion.com/Services/Northwnd.svc/Order_Details" : "http://mvc.syncfusion.com/Services/Northwnd.svc/Orders/" }); var obj = $("#Grid").ejGrid("instance") obj.dataSource(data) } |
$("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js dataSource: window.gridData.slice(0,f), allowPaging: true, columns: [ { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, textAlign: ej.TextAlign.Right, width: 80 }, { field: "CustomerID", headerText: "Customer ID", width: 90 }, { field: "EmployeeID", headerText: "Employee ID", textAlign: ej.TextAlign.Right, width: 80 }, { field: "Freight", headerText: "Freight", textAlign: ej.TextAlign.Right, width: 80, format: "{0:C}" }, { field: "ShipCity", headerText: "Ship City", width: 110 }, { field: "ShipCountry", headerText: "Ship Country", width: 110 } ], actionBegin: function (args) { if (args.requestType == "paging") { current = this.model.pageSettings.currentPage; //Perform data request using secureODataCall getData = secureOdataCall.loadItems(ServiceEndPoint + "myOdataURL/Data");
args.cancel = true; //Cancel paging } }, actionComplete: function(args) { if (this.initialRender && args.requestType == "refresh") refreshPager(this); } });
$.when(getData).done(function (e) { //Update grid and refresh page. $("#Grid").ejGrid("dataSource", e.result); refreshPager($("#Grid").ejGrid("instance"), current, e.count); });
});
//Method to refresh grid`s pager function refreshPager(obj, current, total) { var pager = obj.getPager().ejPager("instance"); pager.model.totalRecordsCount = total; pager.model.currentPage = current || 1; pager.refreshPager(); |