4 Answers, 1 is accepted
0
Hello,
The behavior is expected. The dirty flag is changed because the selected field of the item will be changed when the node is selected. There isn't a way to prevent this but you could use the dataSource change event to set the previous dirty value when the selected field is changed e.g.
Regards,
Daniel
Telerik
The behavior is expected. The dirty flag is changed because the selected field of the item will be changed when the node is selected. There isn't a way to prevent this but you could use the dataSource change event to set the previous dirty value when the selected field is changed e.g.
function
onChange(e) {
if
(e.field && e.action ==
"itemchange"
) {
var
model = e.items[0];
model.dirtyState = model.dirtyState || e.field !==
"selected"
;
model.dirty = model.dirtyState;
}
}
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Fernando
Top achievements
Rank 1
answered on 29 Oct 2015, 12:19 PM
Hello,
Thanks for the answer, it works perfectly. I suppose that if i want to avoid this behaviour when a node is expanded, i just need to replace the code
e.field !== "selected"
(e.field !== "selected" && e.field !== "expanded")
I don't know if there is more events linked to navigation between nodes. I want to avoid the dirty state in this cases.
Regards.
0
Hi,
The updated condition should be sufficient. The only other field that will automatically be set by the treeview is the checked field.
Regards,
Daniel
Telerik
The updated condition should be sufficient. The only other field that will automatically be set by the treeview is the checked field.
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Fernando
Top achievements
Rank 1
answered on 03 Nov 2015, 08:04 AM
Hi again,
that's all i need to know.
Thanks for the info.