@section ScriptSection{
<script src="~/Scripts/jsondata.min.js"></script>
<script type="text/javascript">
$(function () {
window.rowSelected = function (args) {
var employeeID = args.data.EmployeeID; //How to filter 1o days of records
var detaildata = ej.DataManager(window.gridData).executeLocal(ej.Query().where("EmployeeID", ej.FilterOperators.equal, employeeID, false).take(10)); var gridObj = $("#ChildGrid").ejGrid("instance"); gridObj.dataSource(ej.DataManager(detaildata.slice(0, 5)));
// how to get all records for that date range
}
});
</script>
}|
col.HeaderText("Employee Details").Commands(command =>
{
command.Type("Approve")
.ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
Text = "Approve",
Width = "100px",
Click = "onClick1"
}).Add();
command.Type("Reject")
.ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
Text = "Reject",
Width = "100px",
Click = "onClick2"
}).Add();
})
.TextAlign(TextAlign.Center)
.Width(150)
.Add();
})
.
.
.
<script type="text/javascript">
$(function () {
window.rowSelected = function (args) {
var old = args.data.OrderDate;
var fut = new Date(old);
fut = fut.setDate(fut.getDate() + 20);
var detaildata = ej.DataManager(window.gridData).executeLocal(ej.Query().where(ej.Predicate("OrderDate", ej.FilterOperators.greaterThanOrEqual, new Date(old), false).and("OrderDate", ej.FilterOperators.lessThanOrEqual, new Date(fut), false)));
var gridObj = $("#DetailGrid").ejGrid("instance");
gridObj.dataSource(ej.DataManager(detaildata));
}
});
function onClick1(args) {
$("#DetailGrid").ejGrid("option", { "editSettings": { allowEditing: true, allowDeleting: true, allowAdding: true } }); // updating the editiSettings through setmodel
}
function onClick2(args) {
$("#DetailGrid").ejGrid("option", { "editSettings": { allowEditing: false, allowDeleting: false, allowAdding: false } });
}
</script>
|
|
|