PDA

View Full Version : setInnerText vs setInnerHTML in Grid



gte619n
27 Oct 2008, 12:50 PM
Hey Guys,

I've got an EditorGrid that I'm trying to change the value of when the user clicks on a cell. I'm getting some strange behavior when I go to make the change. On the GridEvent, I do a :

grid.getView().getCell( be.rowIndex, be.colIndex );

to get the Cell, then I do a setInnerText to attempt to change the value. Curiously, this changes the innerHTML, not just the innerText. I guess what's confusing me is when I do a getInnerHTML and getInnerText, the values are different, with getInnerHTML being the full HTML value, and innerText being just the text value.

Is there a better way to change that value?

Thanks!

Evan Ruff

gslender
27 Oct 2008, 1:25 PM
you should really be changing the model, or if you need a custom render, using a customcellrenderer to render what you need. directly modifying the grid may not be the best approach

gte619n
27 Oct 2008, 4:03 PM
Thanks for the response. I kind of figured that there was something more to this.

If I change the model, does it redraw 100% of the grid, or does it only redraw what has been changed? I only ask because I can forsee a performance issue, as the table is pretty big.

If that's not a problem, could you give me a little sample of how to update the grid? do I do a refresh somehow or invalidate or what?

Thanks a lot for your help!

Evan