Hello,
I have a ui grid with code to hide the destroy button if only one record left in the grid:
...
columns.Command(command => { command.Destroy().Visible("isLastRecordEmail").Text("Remove"); }).Width(200);
...
function isLastRecordEmail(e) {
return $('\#GridEmails').data('kendoGrid').dataSource.data().length > 1;
}
But if I click the Add button then a new records appears and destroy button will appear for last record to allow to delete the very last record.
My question is, how to hide the destroy button in this case?
I did try to add code:
function isLastRecordEmail(e) {
if ($('\#GridEmails').EditIndexes.Count > 0) return false;
but EditIndexes is undefined.
Could you please help?
Thanks!