dhtmlXgrid - incorret xml on grid refresh

Hi all,



I’ve a really strange problem I’m trying to understand. Here is the situation:



I have a page (let’s call it ParentPage) with a iframe inside (MainFrame) for the main browsing and another one (DialogFrame) to show an inner window (I’m working with extjs)



in the MainFrame page I have a dhtmlXGrid and a dhtmlXTree to create a content explorer-like interface.



When I click on a tree folder I refresh the grid by calling clearAll() and then loadXML(file.xml).

file.xml is linked to my server-side module which reads data from db and provide grid xml.



up to this everything is working perfectly, grid updates on folder change without problem.



Now I’m adding a inner-window popup (loaded in DialogFrame) to provide some filtering options on grid data.

The page reads some options and then calls a function of MainFrame page to refresh the grid:

parent.window.frames[‘center’].setFilter( filer_options);



this function does exactly the same procedure used for tree folders: clearAll and loadXml.



Here come the problem: in IE this works perfectly, while in FF the server module is correctly fired but the browser does not wait for server data but fires immediatly an “incorrect Xml” alert. The modules then complete succesfully, but grid is no more waiting for data :frowning:



1) setFilter function is succesfully called from the dialog frame and it execute without errors nor exceptions.

2) I’ve also tried to fire tree event insead but nothing changed (event fired succesfully, same behaviour)

3) the function is in the same page of tree and grid and both tree and grid are global objects, never overwritten.

4) I’ve checked at packets level, server module send well-formed xml, simply the browser is no more waiting for it beacuse the “incorrect xml” alert has been already rised



Can anybody help me dig out the problem? I really can’t understand it.



thanks in advance and regards

>>Here come the problem: in IE this works perfectly, while in FF the
server module is correctly fired but the browser does not wait for
server data but fires immediatly an “incorrect Xml” alert. The modules
then complete succesfully, but grid is no more waiting for data :frowning:

Problem can be caused by using relative paths, when you loading XML the local path calculated relative to current page, but when you called same command from different frame situation is more complex, path can be calculated relative to frame path or path of main window ( to do things more crazy - IE and  FF implemented  different approaches and calculates relative paths in different manner, one calculates it relative to frame where call executed, second relative to iframe where script execution started )

Also if your iframe, where js thread initiated, was reloaded before XML loaded - it can cause the same problem.

In case of multiframe environment it much more safe to break js thread , it can be done in next manner.

<< subframe



    some_action();

    top.setTimeout(“action_continue”,1);

<< top_frame



    function action_continue(){
          grid.loadXML(…
    }


In such case the loadXML will be called from context of top iframe and problem must be resolved.


xml path was already absolute and no frame reload occurr, but the setTimeout() fixed the problem. :slight_smile:

thanks a lot for the really fast answer!