Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by John Rodriguez on Oct 21, 2008 20:14
open dhtmlx forum
DXHTMLToolbar getItemText()

I am loading a Toolbar via XML and it loads properly.

However, when I do an getItemText(id) call via JavaScript, it returns a zero length string. If I use the addButton() method and call the getItemText(id) property, I get the test back.

Here is the XML:

<?xml version="1.0"?>
<toolbar>
    <item type="buttonSelect" id="fc_budget" text="Budget Select">
        <item type="button" text="Item1" id="fc_bselect_19" />
        <item type="button" text="Item2" id="fc_bselect_20" />
        <item type="button" text="Item3" id="fc_bselect_21" />
        <item type="button" text="Item4" id="fc_bselect_22" />
        <item type="button" text="Item5" id="fc_bselect_23" />
        <item type="button" text="Item6" id="fc_bselect_24" />
    </item>
    <item type="text" id="fc_budgetitem" width="250" text="No Budget" />
    <item type="separator" id="fc_sep1" />
    <item type="button" id="fc_print" img="print.gif" imgdis="print_dis.gif" title="Print" />
    <item type="button" id="fc_export" img="xls.gif" imgdis="xls.gif" title="Print" />
</toolbar>

Any suggestions?
Answer posted by Support on Oct 23, 2008 06:21
According your xml - there are no items (type="button") with text.
You xml contain 2 buttons:
    <item type="button" id="fc_print" img="print.gif" imgdis="print_dis.gif" title="Print" />
    <item type="button" id="fc_export" img="xls.gif" imgdis="xls.gif" title="Print" />
and they are without "text" tag.

Try this:
fix xml to this view:
<item type="button" id="fc_print" img="print.gif" imgdis="print_dis.gif" title="Print" text="Print"/>
and then:
alert(dhxToolbar.getItemText("fc_print"));