I am adding record in grid using startEditingNew
method as below.
var COLUMN_NAME = {
name : "user_name",
lastname : "user_surname",
age : "user_age"
};
addDataToGrid : function (name, lastname, age){
MyGrid_Grid.startEditingNew({
COLUMN_NAME.name: name,
COLUMN_NAME.lastname: lastname,
COLUMN_NAME.age: age
});
}
But, my above function raise error and does not add record to grid. If I use "user_name" string instead of "COLUMN_NAME.name" , It works fine.
How can I use variable as column name??
Thanks in advance