KendoGrid - Update Non Editable column during checkbox change event.

6 posts, 0 answers
  1. Avish
    Avish avatar
    7 posts
    Member since:
    Jan 2018

    Posted 08 Jan Link to this post

    Hi All,

    i am new to KendoGrid ,i am facing couple of issues while implementing teh requirement. Any pointers will be highly appreciated.

    1)  In my grid i have couple of columns , column-1 ( checkbox) and column-2 ( amount/Numeric) . column-2 is non editable.  The requirement is if i click on column-1 ( checkbox) column-2  value should get replace/copied over from some other column (say column-n) . the problem is since its non-editable i am not able to update this column on checkbox click event. if i make column-2 as editable then its working fine. But requirement is prevent it from manual editing  should only be edited from column-1 checkbox click event .   do i need to call   editCell and closeCell in checkbox click event method as a workaround. 

     

    2) How can i call validate event on column-2 , seems  we are updating the column via checkbox click event and not manually( dell edit) , so validation method is not invoked.

     

     

  2. Avish
    Avish avatar
    7 posts
    Member since:
    Jan 2018

    Posted 08 Jan in reply to Avish Link to this post

    Hi All , i am able to accomplish #1 by  dataItem.[column2]=<required Value> instead of using dataItem.set("column2",<required Value>.

    as set wont work with non-editable column.

    #2 - I am still checking how to call the custom validation as the change is not done by updating the cell manually.

  3. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2153 posts

    Posted 10 Jan Link to this post

    Hi Avish,

    If you need to validate the value you need to add the validation logic before changing the value in the model, because the Kendo Validator works over input elements and Kendo editors.

    As for the changing the model values, please ensure that you set the dirty property of the dataItem to true, so it could be handled as updated.

    Additionally, setting fields as non editable when you need to edit them should be avoided. If you need to disable the editing for a column you can use column.editable instead:

    Regards,
    Konstantin Dikov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Avish
    Avish avatar
    7 posts
    Member since:
    Jan 2018

    Posted 16 Jan in reply to Konstantin Dikov Link to this post

    Thanks a lot for your help Konstantin 

    can i suppress dirty field indicator in one column . it should be turned on for other columns as expected . but that read only column should not be updated with with dirty indicator color flag /red triangle in the corner  .

  5. Stefan
    Admin
    Stefan avatar
    1474 posts

    Posted 4 days and 4 hours ago Link to this post

    Hello, Avish,

    The desired result can be achieved using CSS:

    https://docs.telerik.com/kendo-ui/knowledge-base/disable-dirty-indicator-using-css

    The CSS selector has to be made more specific in order to remove it for only a specific column:

    /*This is disable it for the first column only*/
    <style>
      td:first-child .k-dirty{
        display: none;     
      }
    </style>

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  6. Avish
    Avish avatar
    7 posts
    Member since:
    Jan 2018

    Posted 2 days and 21 hours ago in reply to Stefan Link to this post

    Thanks a lot Stefan for the response, i tried a different approach to unmark  the red indicator.

    #1 - Also is to possible to unmark the dirty indicator not at CSS but at data level ( incase the column is just read only and doesn't help in case of any business validation  so we should not get the cell/row as dirty)

    #2 - is there any way to get all the dirty records in one fetch without looping through all the grid rows looking for dirty indicator .

    CSS

    ====

    .k-dirty-clear span {
      border-width:0;
    }

    column level detail

    -----------------------

    attributes:{"class": "k-dirty-unmark"}

Back to Top