I am using Kendo dataSource with transport (read, update, create) functionality. read operation retrieves data and displays it in a Grid. Gird has 3 columns - key, value, and class. Update operation edits a particular row taking in the options object as shown -
parameterMap : function (options, operation) {
if (operation == "update") {
return {key : options.models[0].key, value : options.models[0].value, class : options.models[0].class}
}
}
The options object above is pre-loaded with the data in the particular row of the grid being edited.
However, for create operation, the options object is pre-set to null for all the fields. Options object is loaded when the user enters values for key and value. The value of class remains the same for all the rows, existing and new. How can I access the grid data (for the value of class) within the the code below?
parameterMap : function (options, operation) {
if (operation == "update") {
return {key : options.models[0].key, value : options.models[0].value, class : options.models[0].class}
}
if (operation == "create") {
return {key : options.models[0].key, value : options.models[0].value, class : <what code should go here?>}
}
}
parameterMap : function (options, operation) {
if (operation == "update") {
return {key : options.models[0].key, value : options.models[0].value, class : options.models[0].class}
}
}
The options object above is pre-loaded with the data in the particular row of the grid being edited.
However, for create operation, the options object is pre-set to null for all the fields. Options object is loaded when the user enters values for key and value. The value of class remains the same for all the rows, existing and new. How can I access the grid data (for the value of class) within the the code below?
parameterMap : function (options, operation) {
if (operation == "update") {
return {key : options.models[0].key, value : options.models[0].value, class : options.models[0].class}
}
if (operation == "create") {
return {key : options.models[0].key, value : options.models[0].value, class : <what code should go here?>}
}
}