简体   繁体   中英

how to make only one record in grid as non editable using Kendoui

I want to make only one cell in grid as non-editable using Kendo ui. So that it should not be delete, edit from table.

Basically you can create conditional logic and hide the edit buttons based on the row model. Here is a small example using the dataBound event of the Grid.

         dataBound: function (){
           var grid = this;
           var trs = this.tbody.find('tr').each(function(){
             var item = grid.dataItem($(this));
             if( item.UnitPrice % 5 == 0) {
               $(this).find('.k-grid-edit,.k-grid-delete').hide();
             }

           });               
         },

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM