I try to add
a new row to a treelist. Is the following code a good procedure?:
Call this: tree.editRow(parentCell);
Then I have a function on treelist edit:
private OnEdit(e: kendo.ui.TreeListEditEvent) {
e.model['id'] = -1; //A new, unique and temporarily id
tree.dataSource.add(e.model);
tree.saveRow();
}
If I edit the new row before it is saved to the server, I have to do this to confirm the change:
tree.dataSource.add(e.model);
tree.saveRow();
But if the row already has been saved, I only need to do this:
tree.saveRow();
Is this the procedure? (the procedure is okay with me, but it could be there where a better way)
Please ask, if I’m not clear.
Call this: tree.editRow(parentCell);
Then I have a function on treelist edit:
private OnEdit(e: kendo.ui.TreeListEditEvent) {
e.model['id'] = -1; //A new, unique and temporarily id
tree.dataSource.add(e.model);
tree.saveRow();
}
If I edit the new row before it is saved to the server, I have to do this to confirm the change:
tree.dataSource.add(e.model);
tree.saveRow();
But if the row already has been saved, I only need to do this:
tree.saveRow();
Is this the procedure? (the procedure is okay with me, but it could be there where a better way)
Please ask, if I’m not clear.