I have two issues.
The first is, when I am using the 'inline' or 'popup' editing, the row I am editing gets deleted on cancel click. I know I need to add an "Id" to the Model in my schema but I'm not sure how to do that using remote data. The data coming over does not have any unique identifiers unless you use and AccountNumber and FeeTypeID together.
Second is I am trying to have the UpdateFunction to just do an AJAX call to send the 4 variables to my controller as JSON. I searched and searched but I cannot edit the Update functionality to only send the current editing row to the controller. It sends every row.
Here is my Schema,
schema: {
model: {
fields: {
AccountNumber: { type: "string", nullable: false, editable: false },
Description: { defaultValue: { ID: 1, Description: "Recurring Annual Unified Plan Fee" } },
FeeTypeID: { type: "number", editable: false },
FeeValue: { type: "string", validation: { required: true } }
}
}
}
and here is the update click function
function updateCustomFee(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var AccountNumber = dataItem.AccountNumber;
var Description = dataItem.Description;
var FeeTypeID = dataItem.FeeTypeID;
var FeeValue = dataItem.FeeValue;
alert(AccountNumber);
$.ajax({
type: 'POST',
url: '/Four08b2/EditCustomFeeList',
data: { "accountNumber": AccountNumber, "description": Description, "feeTypeID": FeeTypeID, "feeValue": FeeValue },
dataType: 'json',
success: function (result) {
alert(result);
}
});
}
The first is, when I am using the 'inline' or 'popup' editing, the row I am editing gets deleted on cancel click. I know I need to add an "Id" to the Model in my schema but I'm not sure how to do that using remote data. The data coming over does not have any unique identifiers unless you use and AccountNumber and FeeTypeID together.
Second is I am trying to have the UpdateFunction to just do an AJAX call to send the 4 variables to my controller as JSON. I searched and searched but I cannot edit the Update functionality to only send the current editing row to the controller. It sends every row.
Here is my Schema,
schema: {
model: {
fields: {
AccountNumber: { type: "string", nullable: false, editable: false },
Description: { defaultValue: { ID: 1, Description: "Recurring Annual Unified Plan Fee" } },
FeeTypeID: { type: "number", editable: false },
FeeValue: { type: "string", validation: { required: true } }
}
}
}
and here is the update click function
function updateCustomFee(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var AccountNumber = dataItem.AccountNumber;
var Description = dataItem.Description;
var FeeTypeID = dataItem.FeeTypeID;
var FeeValue = dataItem.FeeValue;
alert(AccountNumber);
$.ajax({
type: 'POST',
url: '/Four08b2/EditCustomFeeList',
data: { "accountNumber": AccountNumber, "description": Description, "feeTypeID": FeeTypeID, "feeValue": FeeValue },
dataType: 'json',
success: function (result) {
alert(result);
}
});
}