SelectButton does not fire if current item text is too short

I have a toolbar with a selectButton that worked fine in 3.0, in 3.5 the onClick event does not fire unless the current item text is of a certain length, here is the code setting up the selectButton. When I hit the down button to the right the menu opens and closes right away, I can keep it open by right-clicking and then select that way, however it is rather awkward. If the selected text is wide enough everything works just fine. Any suggestions how I can make the selectButton to work with text of varying width?

[code]
function InitToolbar(oToolbar)
{
var sURL;

    oToolbar.id = "toolList";

    oToolbar.setSkin(SKIN_NAME);
    oToolbar.setIconsPath(URL_TOOLBAR_IMAGES);

    
    sURL = URL_TOOLBAR_TAG;
    sURL = AddURLParameter(sURL, "dbID", DB_ID);
    sURL = AddURLParameter(sURL, "UID", CreateGUID());

    oToolbar.loadXML(sURL);

    oToolbar.attachEvent("onClick", function (sID) {
        var sType;

        moUI.grid1.editStop(false);
        moUI.grid2.editStop(false);

        sType = this.getType(sID).toUpperCase();
        if (sType == "BUTTONSELECTBUTTON") {
            if (this.getAllListOptions("tbbList").indexOf(sID) >= 0) {

//Do stuff
}
else {
alert(“Unhandled select item encountered!”);
debugger;
}
}
else {
//Handle other button
}
}
cshtml file:
@using Models.Lists;
@model ToolbarResult
@{
Response.ContentType = “text/xml”;
Layout = null;
}




@foreach(vat oItem in Model.List)
{

}

{/code]

In case it wasn’t clear, the general idea of the implementation is to modify the title of the menu to be identical to the last selected item, i.e. the text of the buttonSelect changes dynamically. That worked just fine in 3.0, however seems to be broken in 3.5 or need some setting to achieve.

Here is working sample based on 3.5 suit.
toolbar_itemSelect.rar (314 KB)

Thanks, I tried setting the width to 130 as suggested, however it sets the width of both the buttonSelect and the menu items, so the menu items still cover the pull-down button preventing it from firing. What seems to happen is, when the buttonSelect is left-clicked, menu opens up covering the arw control so the toolBar.objPull[id].arw.onclick is not fired, in cases where the text is shorter than the longest menuitem. Is there a way to set the width of just the buttonSelect and not effect the pull down menu?

I realized this is actually a similar issue to this,

viewtopic.php?f=4&t=12202

my menu is too big to fit in the window, so I needed to set the max-height and overflow values in the skin. This is actually already done and was working in 3.0, however the objects changed name from

div.dhx_toolbar_poly_dhx_skyblue {

to

div.dhx_toolbar_poly_18_dhx_skyblue,
div.dhx_toolbar_poly_24_dhx_skyblue,
div.dhx_toolbar_poly_32_dhx_skyblue,
div.dhx_toolbar_poly_48_dhx_skyblue {

in 3.5 so it didn’t get picked up in the style over-ride.

Has this fix the issue?

Yes, it is working now, thanks.

Ok :slight_smile: