var dataSourceBudgetStatus = new kendo.data.DataSource({
transport: {
read: {
url: APIbaseUrl + "/Workflow/GetBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo
},
update: {
url: APIbaseUrl + "/Workflow/AddUpdateBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo
},
destroy: {
url: APIbaseUrl + "/Workflow/GetBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo
},
create: {
url: APIbaseUrl + "/Workflow/AddUpdateBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo,
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models[0]) {
options.models[0].ExpenseWorkflowId = 4;//parseInt($('input[id$=hdnExpenseId]').val());
return options.models[0];
}
else if (operation == "read" && options.models) {
return options.models;
}
}
},
requestEnd: function (e) {
var type = e.type;
if (type != "read") {
$('#budgetstatusgrid').data('kendoGrid').dataSource.read();
}
},
batch: true,
pageSize: 5,
schema: {
model: {
id: "BudgetStatusId",
fields: {
BudgetStatusId: { editable: false, nullable: true },
ExpenseWorkflowId: { editable: false, nullable: true },
ExpenseHead: { validation: { required: true } },
TotalBudget: { validation: { required: true } },
TotalExpenseIncurredTillDate: { validation: { required: true } },
CurrentExpenses: { validation: { required: true } },
RemainingBudget: { validation: { required: true } }
}
}
}
});
transport: {
read: {
url: APIbaseUrl + "/Workflow/GetBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo
},
update: {
url: APIbaseUrl + "/Workflow/AddUpdateBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo
},
destroy: {
url: APIbaseUrl + "/Workflow/GetBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo
},
create: {
url: APIbaseUrl + "/Workflow/AddUpdateBudgetStatus",
dataType: "json",
type: "POST",
data: budgetStatusInfo,
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models[0]) {
options.models[0].ExpenseWorkflowId = 4;//parseInt($('input[id$=hdnExpenseId]').val());
return options.models[0];
}
else if (operation == "read" && options.models) {
return options.models;
}
}
},
requestEnd: function (e) {
var type = e.type;
if (type != "read") {
$('#budgetstatusgrid').data('kendoGrid').dataSource.read();
}
},
batch: true,
pageSize: 5,
schema: {
model: {
id: "BudgetStatusId",
fields: {
BudgetStatusId: { editable: false, nullable: true },
ExpenseWorkflowId: { editable: false, nullable: true },
ExpenseHead: { validation: { required: true } },
TotalBudget: { validation: { required: true } },
TotalExpenseIncurredTillDate: { validation: { required: true } },
CurrentExpenses: { validation: { required: true } },
RemainingBudget: { validation: { required: true } }
}
}
}
});