1

We have the requirement to edit a specific Kendo grid column if model flag status is "yes". It has to done by using a jquery function.

Ex code:

columns.Bound(p => p.Qty).Width(120).ClientTemplate("..some events and function data values----");
columns.Bound(p => p.oldQty).Width(120);
columns.Bound(p => p.id);

I want to edit the QTY column alone based on condition.

G_P
  • 2,100
  • 3
  • 16
  • 18
gopim
  • 35
  • 6

1 Answers1

0

Using the ClientTemplate of that column, you can pass the column value to a function where you can alter how the value is displayed, like so:

columns.Bound(p => p.Qty).Width(120).ClientTemplate("#=myNewFunction(Qty)#");

then your js function:

    function myNewFunction(valueToEdit) {
        //ALTER valueToEdit based on your condition here
        return "new updated value";
    }
G_P
  • 2,100
  • 3
  • 16
  • 18
  • Thanks for your response.also suggest please how to make QTY cell is not editable.If authorization flag is No. – gopim Jun 11 '20 at 07:14
  • Have a look at https://stackoverflow.com/a/20881973/493557 and https://stackoverflow.com/a/55241454/493557. If you want to edit your original question and add that additional question, I will update my answer as well and you can mark it as the correct answer – G_P Jun 11 '20 at 10:07