removing Grid item

I am trying to remove gridcell items.
in the sidebar I create an element.Grid object.
of which two of the attributes is cellCreator and cellUpdater.
In the cellUpdater function I save the 'cell'(passed parameter into function).
The cellUpdate function is called throught the messagehandler().

I exit the above sidebar and reenter with different data as before through the messagehandler.
The first thing I do is call this.controls.grid_object.removeChild(passing cell saved above).
The cell is not removed and the new cells are appended to the previous cells.
How does one delete these previous cells?

1 Reply
  • Hmm... maybe I don't understand your use case, but it looks like you are working too hard. The pattern I use for grids is view one calls a function to compute the new dataset, then launches view two where I connect the dataset to the grid in the updateView function/callback. As in...


    this effectively deletes all the old values and adds the new ones. (The actual pattern is more usually that view one calls a remote http JSON api to a database. The callback from the url.fetchAsync() then actually does the launching of view two.)

    Hope that helps!

Recent Posts

in Design / Interaction - Yahoo! TV Widgets