Ribbon -> ButtonSelect -> getItemText problem

Hello,

Is there a way to get the text from an element in a ButtonSelect into a Ribbon ?

When i use " myRibbon.attachEvent(“onClick”, function(id) {}); ", i get the ID without any problem, but when i try to use this id and to get the text with " myRibbon.getItemText(itemId); ", the value returned is null…

myRibbon.attachEvent(“onClick”, function(itemId) {
var text = myRibbon.getItemText(itemId);
alert(text); // value null returned
});

Thank you for your help

Hi

please try the following:

  1. include attached file from zip on the page, right after dhtmlx.js (or ribbon.js)

  2. then in your code:

myRibbon.attachEvent("onClick", function(itemId, masterId) { if (typeof(masterId) != "undefined") { // button select var text = myRibbon.getItemOptionText(masterId, itemId); console.log("option", masterId, itemId, text); } else { // any other button var text = myRibbon.getItemText(itemId); console.log(itemId, text); } });
ribbon_ext.zip (556 Bytes)