Hi All,
I have parent and child grid. When user create new, there must be 1 record in the child grid before it can save.
How can i validate this on client side before sending request to server?
So far i got this reply from my support ticket but it didn't work because at grid saveChanges event, e.container = null.
How do i get the detailrow on grid saveChanges event?
function onsaveChanges(e) {
var detailRow = e.container.next(".k-detail-row");
if (detailRow.length) {
var grid = detailRow.find("[data-role='grid']").data("kendoGrid");
var data = grid.dataSource.data();
if (data.length === 0) {
e.preventDefault();
alert("error message");
}
}
}
Thanks in advance.
I have parent and child grid. When user create new, there must be 1 record in the child grid before it can save.
How can i validate this on client side before sending request to server?
So far i got this reply from my support ticket but it didn't work because at grid saveChanges event, e.container = null.
How do i get the detailrow on grid saveChanges event?
function onsaveChanges(e) {
var detailRow = e.container.next(".k-detail-row");
if (detailRow.length) {
var grid = detailRow.find("[data-role='grid']").data("kendoGrid");
var data = grid.dataSource.data();
if (data.length === 0) {
e.preventDefault();
alert("error message");
}
}
}
Thanks in advance.