This is a migrated thread and some comments may be shown as answers.

Dynamic columns onchange event

3 Answers 1995 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 03 Aug 2017, 02:29 AM

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.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 04 Aug 2017, 11:36 AM
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.
0
Aaron
Top achievements
Rank 1
answered on 07 Aug 2017, 08:19 AM

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

 

 

0
Stefan
Telerik team
answered on 09 Aug 2017, 06:25 AM
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.
Tags
Grid
Asked by
Aaron
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or