Hello,
I am using the pro 1.5 version of the whole suit. I am trying to find the command to edit a cell programatically.
The situation I have is this. I have a ro cell with an event handler attached so when the user click on this column a pop up form appears with different options according to the row. The user enter a various amount of data in verious field in this pop which then updates the database accordingly. This all works beautifully, the final stage I can’t work out is how then to update the value in the cell with the text sent back from my function. I can return the text ok so just need to reference the cell by the header label and row id and update it.
Is there a command that does this?
Many thanks
Scott
Basically you can set value of cell by
grid.cells(i,j).setValue(“new value”);
where
i - id or row
j - index of column
Many thanks for this,
I have another question related to this.
I have a grid that with functions attached to various columns that update my database when a cell is edited. However if the user wants some more details on an item in a row they can click on one particular row and get a form in a pop up floating div. From this they can also update the same details - from dropdowns that run the same function tirggered from editing the cell.
My question is if I set it so when they edit from this pop up -which I then wnat to write to the grid and update the value they have just changed - will this trigger the function again? If so I can just set the pop up to edit the relevant grid cell rather than run the function.
Hope that is clear?
Scott
By default “setValue” doesn’t trigger any event except onCellChanged
>>I have a grid that with functions attached to various columns
I’m not pretty sure which method of data update you are using, in case of dataProcessor you can mark whole row as updated by
dataproc.setUpdated(id,true);
If you are using onEditCell event you can force event handler call in next way
grid.cells(i,j).setValue(“new value”);
grid.callEvent(“onEditCell”,[2,i,j]); //this will generate onEditCell event and will call any code attached to event