Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Andrew on Sep 03, 2007 16:11
open dhtmlx forum
Tree place disorder, toolbar problem

I have some widgets in a table with two rows.
When I want to put a tree element into another place, and I catch it, if I pull it out from the tree area (for exaple: over onto the other row), it pushes away the two rows from each other, and creates an empty line.
It is, i think, because a temporary div element is created (connected to the mouse) for the caught element, and it somehow disturbes the structure of the table or the object divs.
have you got some idea, how to avoid this problem. (I do not want to disable drag and drop :))

At Second:

 oToolbar.getItem('0_cancel').setText('');

it doesn't work, firefox (firebug) sais: oToolbar.getItem("0_cancel") has no properties

under IE, this function works fine, but if i write only a space in the xml as name for ImageTextButton, it sets "undefined" name for the button.

how to handle this situation? (I want no text in the button at startup, i will only set it, if something happens)


thanks
Answer posted by Andrew on Sep 04, 2007 16:36
for the second problem, i found out, that even if Mozilla handles the window.onload function better, somehow, when it reads (getItem) for the Toolbar item, it is not created yet, so that's why, the error is. But i don't get, how IE can handle this better... :)

anyway, I tried a lot of solution to handle the window.onload at the same time for all browsers, till then, only IE was able to catch the call for the toolbar item, but neither Moz nor Opera can't see the item in the onLoad handler function.
Answer posted by Andrew on Sep 04, 2007 16:51
one more thing:

it could be better solution, but unfortunately it also doesn't work :(:

on creation:
    oToolbar.setOnShowHandler(onToolbarShow);

function onToolbarShow() {
    oToolbar.getItem('0_cancel').setText(' ');
}
Answer posted on Sep 05, 2007 18:12
>>hen it reads (getItem) for the Toolbar item, it is not created yet
The elements become available only after XML loading, you can use something similar to next

oToolbar.loadXML(url,function(){
     oToolbar.getItem('0_cancel').setText('');
});
   

>>only a space in the xml as name for ImageTextButton
By XML rules empty space is counted as absense of data, you can use
     
which will be converted to whitespace
Answer posted by Andrew on Sep 06, 2007 11:01
thanks for the first, i'll try it

for the xml empty space... Oh my God, silly me :).... :S

but can you tell something about the tree drag and drop bug ?
Answer posted by Andrew on Sep 06, 2007 11:13
other funny part is, that this:

oToolbar.loadXML(strXmlPath, function() { oToolbar.getItem('0_cancel').setText(''); oToolbar.disableItem('0_cancel'); });

is only works under IE, but not in FF or Opera :|. (viva to browser compatibility, what never was :D)
Answer posted by Andrew on Sep 06, 2007 11:18
sorry, I'm getting dizzy again.
so, the previously mentioned function doesn't work in any of the browsers,

and this one is only in IE:

oToolbar.setOnShowHandler(onToolbarShow);

function onToolbarShow() {
    oToolbar.getItem('0_cancel').setText(' ');
    oToolbar.disableItem('0_cancel');
}

so the problem still exists. :(