self.dmSearch = ej.DataManager({url: "/v2/patients/GetPatients",adaptor: new ej.UrlAdaptor});self.ejConfig = function () {$('#searchPatientsGrid').ejGrid({dataSource: self.dmSearch,actionBegin: function (args) {console.dir(args);},columns: [{ field: "Rank", headerText: "Rank", width: 50, textAlign: ej.TextAlign.Center },{ field: "PatientId", headerText: "PID", width: 50, textAlign: ej.TextAlign.Center },{ field: "FirstName", headerText: "First Name", width: 150 },{ field: "LastName", headerText: "Last Name", width: 150 },{ field: "Facility", width: 250 },{ field: "Age", width: 50, textAlign: ej.TextAlign.Center },{ field: "Sex", width: 75 },{ field: "Program", width: 75 },{ field: "ActivityCount", headerText: "Activities", width: 75, textAlign: ej.TextAlign.Center },{ field: "ActivitiesPastDueCount", headerText: "Past Due", width: 75, textAlign: ej.TextAlign.Center },{ field: "AssignedTo", headerText: "Assigned To", width: 200 }],isResponsive: true,enableResponsiveRow: true,gridLines: ej.Grid.GridLines.Horizontal,allowScrolling: true,scrollSettings: { width: "auto", height: 500, enableVirtualization: true, allowVirtualScrolling: true },allowFiltering: true,allowSorting: true,sortSettings: { sortedColumns: [{ field: "PatientId" }]},allowMultiSorting: true,toolbarSettings: { showToolbar: true, customToolbarItems: [{ templateID: "#refreshGrid" }] },
var dataManager = ej.DataManager({ url: "/Home/DataSource", adaptor: new ej.UrlAdaptor() });
$("#Grid").ejGrid({
dataSource: dataManager,
actionComplete: function(args){
if (args.requestType == "sorting" || this.model.sortSettings.sortedColumns.length>0) {
this._needVPaging = false;
}
},
}); |