Is there a way to return a model without using get(id) ?
I am using this with the grid, and using a template for the column. In the template, I use reference the Id to get the model.
However, when creating a new row with the grid, there is no "Id" set so I need to find another way to access the model.
I can manually access the underlaying data with the "after" code.
But I want to to return the model so I can use .set() -- so that the 'modified' field is toggled -- so that the "save" toolbar button with run the update method.
Before:
After:
The after version sets the data, but it does not update the modified flag -- so when I click the "save" button the grid toolbar, it does not run the update method.
I am using this with the grid, and using a template for the column. In the template, I use reference the Id to get the model.
However, when creating a new row with the grid, there is no "Id" set so I need to find another way to access the model.
I can manually access the underlaying data with the "after" code.
But I want to to return the model so I can use .set() -- so that the 'modified' field is toggled -- so that the "save" toolbar button with run the update method.
Before:
$(
'#gridEmailAddress'
).data(
'kendoGrid'
).dataSource.get(#=Id#).set(
'StatusTypes[0].Flag'
,
true
)
After:
$(
'#gridEmailAddress'
).data(
'kendoGrid'
).dataItem(
this
.parentElement.parentElement).StatusTypes[0].Flag=
true
;
The after version sets the data, but it does not update the modified flag -- so when I click the "save" button the grid toolbar, it does not run the update method.