Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141778 | Jan 3,2019 11:34 PM UTC | Jan 18,2019 04:26 AM UTC | ASP.NET MVC - EJ 2 | 10 |
![]() |
Tags: Grid |
. . .
button.element.onclick = function () {
var hostUrl = 'https://ej2services.syncfusion.com/production/web-services/';
var newData = new ej.data.DataManager({
url: hostUrl + 'api/Orders',
adaptor: new ej.data.WebApiAdaptor(),
crossDomain: true
});
gridObj.setProperties({ dataSource: newData, pageSettings:{currentPage:1} });
} |
var grid = new ej.grids.Grid({
dataSource: { count: window.orderData.slice(0, 45).length, result: window.orderData.sort(function (x, y) { return x.OrderId >= y.OrderId; }).slice(0, 15) },
allowPaging: true,
actionBegin: function (o) {
console.log(o)
if (o.requestType === 'paging' && !dsSet) {
var hostUrl = 'https://ej2services.syncfusion.com/production/web-services/';
var newData = new ej.data.DataManager({
url: hostUrl + 'api/Orders',
adaptor: new ej.data.WebApiAdaptor(),
crossDomain: true
});
grid.dataSource = newData;
dsSet = true;
}
}
}); |
var dsSet = false;
var button = new ej.buttons.Button({ width: '100px' });
button.appendTo('#primarybtn');
var grid = new ej.grids.Grid({
dataSource: { count: window.orderData.slice(0, 45).length, result: window.orderData.sort(function (x, y) { return x.OrderId >= y.OrderId; }).slice(0, 15) },
allowPaging: true,
actionBegin: function (o) {
debugger
console.log(o)
if (o.requestType === 'paging' && !dsSet) {
this.defaultLocale.EmptyRecord = "";
var hostUrl = 'https://ej2services.syncfusion.com/production/web-services/';
var newData = new ej.data.DataManager({
url: hostUrl + 'api/Orders',
adaptor: new ej.data.WebApiAdaptor(),
crossDomain: true
});
grid.dataSource = newData;
dsSet = true;
}
},
...
});
grid.appendTo('#Grid');
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.