//$('.column-edit').closest('a').off('click').on('click', function (e) {
// alert('edit');
// return false
//});
$(e).unbind();
alert('sss');
return false;
e.stopPropagation();
e.preventDefault();
}
But it still shows the Update and Cancel button
0
Anton Mironov
Telerik team
answered on 23 Jun 2020, 01:48 PM
Hello, Muhammad,
Thank you for the provided code.
In order to disable the Edit button by condition try the dataBound event instead of edit. When the edit event is handled it is too late to disable its default behavior. In the dataBound event handler, target the edit button by class (.k-grid-edit) and attach a click event handler to it. Get the dataItem for the current row and check the condition. If the condition returns true, prevent the default behavior of the event, and stop immediate propagation.
The full implementation could be found in the demo below: (the condition for disabled Edit buttons is field "Units In Stock" to be less than 50)
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.