Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by SFGolfer on Jun 15, 2009 16:20
open dhtmlx forum
updateFromXML when grid is in filtered state

I am attempting to update the grid while keeping the same filtered state (via #text_filter, #select_filter, etc):

mygrid.filterBy(0);
mygrid._srowsCol=mygrid._f_rowsBuffer=mygrid._srowsBuf=null;
mygrid.updateFromXML(gridQString);
mygrid.filterByAll();


The result is a JS error: this.rowsBuffer[this.getRowIndex(id)] is undefined


Answer posted by dhxSupport on Jun 16, 2009 01:58
>>The result is a JS error: this.rowsBuffer[this.getRowIndex(id)] is undefined
To remove all rows from the grid and load new better to use mygrid.clearAll(header) where header - header - (boolean) enable/disable cleaning header.
Actually updateFromXML() method doesn't require all rows to be cleared because of method just refresh grid's value. 
updateFromXML(url, insert_new, del_missed, afterCall) has parameters:
* insert_new - insert new items
* del_missed - delete missed rows
* afterCall - function, will be executed after refresh completted

Answer posted on Jun 16, 2009 05:26

>mygrid.clearAll(header) where header - header - (boolean) enable/disable cleaning header

I'm confused by this statement.  Can you elaborate with sample usage?

Answer posted by dhxSupport on Jun 16, 2009 05:41
Answer posted on Jun 16, 2009 07:04

Obviously I am attempting to refresh the grid without having to reload the entire grid or clear it of its current state.

I have a button with this single command:

mygrid.updateFromXML(gridQString)

The grid refreshes without error in FireFox, Chrome and Safari. 

However, it does not work in IE6, IE7 or IE8 and displays this error::

Message: Object doesn't support this property or method
Line: 638
Char: 32
Code: 0
URI: http://../dhtmlxgrid.js
http://intranet/demo/dhtmlxgrid/dhtmlxgrid/codebase/dhtmlxgrid.js

Answer posted by dhxSupport on Jun 16, 2009 07:16
Please send us example including files which you are using to initialize grid where we reproduce this issue.