I create custom button on ListView. Then i create new object, new button has null ID. Please see snipet.
Steps:
- Click Create.
- Fill edit form.
- Click save.
Click options and see alert null;
save: function(e) { // What i can do this, if i know id here? e.model.id = ids++; },
Typically
id
is returned by the server but in your example where theDataSource
is a local object you can manually assign it but you should assign it to theid
not toid
. I.e.: in your model definition theid
iscode
(notid
) sosave
function should be:Your snippet modified here