PDA

View Full Version : adding new records into an existing store will clear previous style customizations



ruralclimber
17 Mar 2010, 8:37 AM
Hi,

I have several records loaded remotely into the Grid, and the background color of certain cells that the user has clicked is changed to red.

After adding new records retrieved from remote server into the grid by calling the following method:



store.load(
params: par ,//parameters sent to remote server
add:true
)


the grid is refreshed and all of the pervious style customizations are removed. The grid shows the original default style.

However, calling 'store.insert(index, records)' will not clear the grid's existing style settings.

in my case, I have to use store.load({add;true}), because the new records are retrieved remotely.


could anyone have some experience to deal with this?


Thx
Warren

ruralclimber
17 Mar 2010, 8:42 AM
the goal I want to achieve is to keep all existing style customizations even after new records are added into the grid.

Animal
17 Mar 2010, 8:44 AM
What, you have modified the inline styling of cells post render?

That's a Bad Idea

ruralclimber
17 Mar 2010, 8:53 AM
for the cell clicked by the user, I do the following to customize the cell's background


cell.className = cell.className +' grid-cell-highlight';//grid-cell-highlight will set the red background


the reason why I want to do so is that, once the user clicks a cell, the data in this cell will be copied to a form(more actions are done for this event), and the visual change of this cell will help the user to memorize what cells he/she has clicked or say, performed the actions.


thx
Warren