Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by otter on Jul 01, 2008 00:42
open dhtmlx forum
dhtmlxtree refreshItem

I have a tree with XML and XML auto loading.
When i use the refreshItem after a change this doesn't work in Safari. In Safari all items in the refreshed tree item will be "deleted" after the refreshItem call.
So i must load the full tree new to see the change correctly.
Answer posted by Support on Jul 01, 2008 01:48
Which version of Safari you are using?
The refreshItem functionality works correctly in local samples
    http://dhtmlx.com/docs/products/dhtmlxTree/samples/loading_processing_data/pro_dyn_operations.html

By default refreshItem delete all child items and load new XML from server for branch in question, if you need to preserve local changes you can try to use
    tree.smartRefreshItem
    tree.smartRefreshBranch
Answer posted by otter on Jul 01, 2008 02:21
Latest Safari.

Try refreshItem():
Firefox3: all ok
MSIE6: works but height of tree will be resized
Safari3: delete all items in refreshed item

Try smartRefreshItem():
Firefox3: all ok
MSIE6: works but height of tree will be resized (fewer than with refreshItem)
Safari3: nothing happens, don't work

Try smartRefreshBranch():
Firefox3: all ok
MSIE6: works but height of tree will be resized (fewer than with refreshItem)
Safari3: nothing happens, don't work
Answer posted by otter on Jul 01, 2008 02:51
problem found:
i have a frame with the tree and another frame where i call the refresh, that doesn't work in Safari.
Example:
frame with tree has id frame_tree:
so i called from the other frame:
parent.frame_tree.tree.refreshItem(id); -> doesn't work in Safari
Answer posted by Support on Jul 01, 2008 03:57
While all frames loaded with document from the same domain there must not be any problems in call itself, but if you are using relatinve paths the situation can be a bit more complex.
The refreshItem will load xml file by path relative to location of frame from which command called, so in result it may be not expected url.
Please try to use debug version of dhtmlxcommon
    http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&q=2545&ssr=yes&s=dhtmlxcommon
and check which file fethced for refresh call.

Answer posted by otter on Jul 01, 2008 04:12
All scripts are in the same location.
I used the debug version and after the call of refreshItem no debug info will be shown in Safari -> no call
Only on loading the tree the calls will be shown.
Answer posted by Support on Jul 01, 2008 05:47
Is the name of frame hardcoded in HTML, or it set dynamically by the script? (in second case browser may not found target frame - the situation is specific for some versions of browser only )
Answer posted by otter on Jul 01, 2008 05:52
Name is hardcoded, i have now set the xml url from relative to an complete url with http:// and this works.