var dataManger = ej.DataManager({
url: "/Home/DataSource",
insertUrl: "/Home/Insert",
updateUrl: "/Home/Update",
removeUrl: "/Home/Delete",
adaptor: "UrlAdaptor"
});
$(function () {
$("#Grid").ejGrid({
dataSource: [],
. . .
});
});
</script>
<script type="text/javascript">
function refreshData() {
var grid = $('#Grid').ejGrid('instance');
grid.option({
dataSource: dataManger,
query: ej.Query().sortBy("EmployeeID", ej.sortOrder.Descending, false)
});
grid.model.sortSettings.sortedColumns.push({field: "EmployeeID", direction: "descending" })
}
</script>
|