Dynamic columns onchange event

4 posts, 0 answers
  1. Aaron
    Aaron avatar
    3 posts
    Member since:
    Jul 2017

    Posted 02 Aug 2017 Link to this post

    I just learn the below demo to present dynamic columns and data.

    http://jsfiddle.net/darrenarbell/4HTEr/

    I am facing the problem if i want to do the cell onchange event how could i implement ?

    For example,

    First row Column 0 value is 2,i edit to change value to 3, i want column 1,2,3,4 cell value all add+1.

    I don't know where could i add onchange event to ?

    Deeply appreciated your help  thanks.

     

     

     

  2. Stefan
    Admin
    Stefan avatar
    3067 posts

    Posted 04 Aug 2017 Link to this post

    Hello Aaron,

    In this scenario I can suggest using the cellClose event as it will be fired when the value of the cell is changed:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-cellClose

    I made an example demonstrating how to set a value of the other columns when a cell is edited. The example is using the dataItem method of the Grid to retrieve the row data:

    http://dojo.telerik.com/omeTo

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-dataItem

    Please have in mind that this example only demonstrates the standard approach, and additional logic can be added depending on the scenario.

    Regards,
    Stefan
    Progress Telerik
    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.
  3. Aaron
    Aaron avatar
    3 posts
    Member since:
    Jul 2017

    Posted 07 Aug 2017 in reply to Stefan Link to this post

    Hello Stefan,

    Thank your reply,but my scenario is different than you thought.

    The column is dynamic, i am facing the dynamic filed how to use inline edit to change other cell .

    Your example name,age are all fixed fields,but my scenario all fields are created during run-time.

    Do you have any idea ? appreciated that

     

     

  4. Stefan
    Admin
    Stefan avatar
    3067 posts

    Posted 09 Aug 2017 Link to this post

    Hello Aaron,

    In this scenario, I can suggest retrieving the current column names using the getOptions method of the Grid and then use that values instead of hard coded ones:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-getOptions

    http://dojo.telerik.com/omeTo/3.

    Please have in mind that depending on the scenario, this may have some limitation which may need to be handled with custom logic using jQuery.

    Regards,
    Stefan
    Progress Telerik
    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