Search code examples
javascriptjquerytreegridjqwidget

jqwidgets treegrid setcellvalue function not working on editor on change event


I am using the jqwidgets tree grid

I am trying to implement onchange listener for the cell editor based on the following requirements

  • On Change of a cell value in particular row it should make changes in other cell in that particular row.

What I have tried so far for this is :

In the init editor function I have added following code for onchange listener

initEditor: function (row, cellvalue, editor, celltext, width, height) {

                      editor.bind('change',function onCHangeOf(value) {
                     curValue = this.value;

                    $("#treeGrid").jqxTreeGrid('setCellValue', row, 'Total', curValue);
                     });

                   }

But the above code is not working when I am trying to setCellValue for the cell Total

I have created the following JSFiddle - http://jsfiddle.net/3zGhL/8/

I have also used other event listener for the same implementation like onBlur,onCellValuechanged but the problem still exists that is where i think the problem is with the setCellValue function i am using here

Can anyone please help me out.


Solution

  • setCellValue sets the value of a Cell and it does it correctly even in your sample, but note that it would not update automatically the value of an already opened Cell Editor, because by default your implementation overrides a default logic. If you want to set the value of an editor, use the initEditor of your "Title" column.