Update grid column template

2 posts, 0 answers
  1. Ricardo
    Ricardo avatar
    1 posts
    Member since:
    Jan 2017

    Posted 24 Apr 2017 Link to this post

    Hi,

    How can I update a column template based on a selected option from my context menu?

    So when I select a row in my grid and right click the mouse to open the context menu I would like to update the status column with the selected option from my context menu.

    so far the I build this exampl: http://dojo.telerik.com/@Ricardo%20Coelho/AyeVUz/11

     

    Could someone help me with thins?

    Thanks.

     

  2. Stefan
    Admin
    Stefan avatar
    2893 posts

    Posted 26 Apr 2017 Link to this post

    Hello Ricardo,

    The desired result can be achieved using jQuery to change the content of the td element based on the selection from the context menu. Please have in mind that as these values are not part of the dataSource they will be lost if the Grid is re-rendered:

    http://dojo.telerik.com/OhekO

    If the values are part of the dataSource, I can suggest instead of changing the text to set a new value to the 
    field:

    row = $(this).closest("tr"),
    grid = $("#grid").data("kendoGrid"),
    dataItem = grid.dataItem(row);
    dataItem.set("columnName", "newValue");

    I hope this is helpful.

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top