Combo attach on toolbar

Hi ,
I try to attach combo on toolbar.
I get code from forum. Combo is visible on toolbar but i receive a NOT_INITIALIZED_ERROR
when i try to select an option.
Can you Help me ???

code:

var protocollo_toolbar = area_protocollo.attachToolbar(); (area_protocollo is layout cell . toolbar is attached on layout cell area_protocollo)

Here code to attach combo on toolbar


protocollo_toolbar.addText(“combo”, 40, “”);
var comboDIV = protocollo_toolbar.objPull[protocollo_toolbar.idPrefix+“combo”].obj;
comboDIV.style.margin=‘2px’;

protocollo_toolbar.objPull[protocollo_toolbar.idPrefix+“combo”].obj.innerHTML = “”;
comboDIV.onselectstart = null;
var combox = new dhtmlXCombo(comboDIV,“alfa”,100);
combox.loadXML(“combopersona.xml”);
combox.setComboValue(‘’);
combox.setComboText(‘’);


Thanks a Lot !!
Best regards

Hi
Here is a working demo for you
13.02.01combo.rar (768 KB)

Hi Darya,
I Have tried with your demo sample trace but combo on toolbar doesn’t appear and I receive this error:
[15:12:06.576] TypeError: parent is null @ apache/plethos/Library/base/dhtmlx.js:2563

Code :

var protocollo_toolbar = area_protocollo.attachToolbar();
protocollo_toolbar.setIconsPath(“img/pulsanti/”); protocollo_toolbar.loadXML(“toolbar_grid_registroprotocollo.xml?etc=” + new Date().getTime(), function() {
protocollo_toolbar.disableItem(“modifica”);
protocollo_toolbar.disableItem(“elimina”);

} );


protocollo_toolbar.addText(‘cb’, 0, ‘

’);
var dhxCombo = new dhtmlXCombo(“combo”, “alfa”, 200);
dhxCombo.loadXML(“combo.xml”);
dhxCombo.setComboValue(’’);
dhxCombo.setComboText(’’);

P.s. My toolbar is Attached with layout cell .

what I did wrong ??

Many thanks
antonello

You need to put combo in loadXML callback:

[code]protocollo_toolbar.setIconsPath(“img/pulsanti/”); protocollo_toolbar.loadXML(“toolbar_grid_registroprotocollo.xml?etc=” + new Date().getTime(), function() {
protocollo_toolbar.disableItem(“modifica”);
protocollo_toolbar.disableItem(“elimina”);

protocollo_toolbar.addText(‘cb’, 0, ‘

’);
var dhxCombo = new dhtmlXCombo(“combo”, “alfa”, 200);
dhxCombo.loadXML(“combo.xml”);
dhxCombo.setComboValue(’’);
dhxCombo.setComboText(’’);
} );[/code]

Hi Darya,

I made the change, but the problem remained …
Have you other suggestion to solve the problem??
many thanks
regards
Antonello

Attach completed demo and we will test it.
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Hi Darya,

I have resolved how you see below:

old instruction :
var layout_protocollo = new dhtmlXLayoutObject(parent.dhxLayout.cells(“b”), ‘3E’);

new instruction :
var layout_protocollo = new dhtmlXLayoutObject(document.body, ‘3E’);

What do you think about ??

Many thanks
Best regards.
Antonello

It shouldn’t influence

Hi Darya,

I don’t know … but after this modify combo is visualized and work fine.

Can you verify where is the difference??

Many thanks
Best regards
Antonello

It really shouldn’t influence. It is some features of your code.