I create custom button on ListView. Then i create new object, new button has null ID. Please see snipet.
Steps:
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 the DataSource
is a local object you can manually assign it but you should assign it to the id
not to id
. I.e.: in your model definition the id
is code
(not id
) so save
function should be:
save: function(e) {
e.model.code = ids++;
},
Your snippet modified here