Hello,
is it possible to attach a comboxbox as node? i have a huge tree and want to let the user have a kind
of elegant possibility to filter the nodes. Okay, i can do this also outside, but by attaching it to a nod, it is very clear from
the ui perspective to what node, the filter corresponds.
Example:
A combobox beneath the Object node with possible Statuses:
Objects [STATUS]
|
----
Best regards, Stefan Riedel-Seifert
Hello,
you can place html elements into the tree. In case of xml loading:
…
<![CDATA[]]>
…
If you meant dhtmlxcombo, it can be initialized after xml loading as follows:
…
tree.loadXML(url,function(){
combo = new dhtmlXCombo(“combo_zone”,“alfa”,200);
combo.loadXML(combo_xml);
combo.attachEvent(“onChange”,function(){
/your code here/
})
})
But tree doesn’t provide API for filtering. Possibly filtering can be executed by smartRefreshItem method.
tree.smartRefreshItem(itemId,url+"?combo_value="+combo.getActualValue());
Here url is path to server-side script that should returns the xml with necessary child nodes.
Hi,
the xml is well formed and looks good, but the display is corrupt and the combobox doesn’t load.
i could’nt find the error .
Best Regards, Stefan
Please, check that dhtmlxcombo libraries are included. You can download the package here dhtmlx.com/docs/products/dht … _init.html
Regarding incorrect display - could you please provide the example of the xml, that you try to load, and code of tree initialization.
Hi,
the files are correctly bound: i can instantiate a separate combobox via:
<div id=“combo_zone2” style=“width:200px; height:30px;”></div>
<script>
var z = new dhtmlXCombo("combo_zone2", "alfa2", 200); z.readonly(1); z.loadXML("../common/data.xml");
</script>
I can avoid the incorrect display by
SPAN {
font-family: "Arial monospaced for SAP";
font-size: 8pt;
color: #000000;
background: #FFFFFF;
}
.L0S33 {
color: #4DA619;
}
<![CDATA[<div id=combo_own></div>]]>
but will get ann error on the page 'Object required'.
If i use
SPAN {
font-family: "Arial monospaced for SAP";
font-size: 8pt;
color: #000000;
background: #FFFFFF;
}
.L1S52 {
color: #0000FF;
}
<div id=combo_own> my xml looks like:
But the display is incorrect and the javascript error is the same 'Object required'.
Best regards,
Stefan
i’ve changed the encoding to
SPAN { font-family: "Arial monospaced for SAP"; font-size: 8pt; color: #000000; background: #FFFFFF; } .L1S32 { color: #3399FF; }iso-8859-1 , but the same result
The provided xml isn’t correct. The correct one is
<?xml version="1.0" encoding="utf-8" ?>
<![CDATA[ FR (Released) (1)
<![CDATA[ FR (Released) (1) ]]>
… okay, misunderstanding from my side.
the code is
tree.loadXML(“objects.xml?uname=<%=sy-uname%>”,function(){
combo = new dhtmlXCombo(“combo_own”,“alfa”,200);
combo.loadXML(combo.xml);
combo.attachEvent(“onChange”,function(){ })
})
the xml
the combobox appears in tree, but without list entries and a javascript error: 'undefined' is null or not an object.
if i load the options via
SPAN {
font-family: "Arial monospaced for SAP";
font-size: 8pt;
color: #000000;
background: #FFFFFF;
}
.L0S32 {
color: #3399FF;
}
combo.addOption([[1,1111],[2,2222],[3,3333],[4,4444],[5,5555]]);
all is fine.
If changed to combo.loadXML("combo.xml"); and now all is ok.