Hi,
Like many other users, I set the value and state of controls on the ribbon to show status for the currently selected values much like a word processor shows the font, font-size, alignment, etc.
So, having the third parameter (callback) in setItemState and setValue is huge.
However, in looking through the documentation and sources, I don’t see that third paramter (callback - true/false) for the buttonCombo. So, when I call
myRibbon.setValue(“font-size”, dropDownFontSize);
, it triggers the onSelectOption event.
Please let me know how to update the value in the buttonCombo without triggering the onSelectOption event.
There is similar issue also with a combo attached to a form. So when combo value/text is updated via script (e.g. in sample 08_combo.html: myForm.setItemValue(‘format’,‘WMA’); myForm.getCombo(‘format’).setComboText(‘WMA’) and then clicking anywhere else in the form combo value/text is reverted back to its previous value even if free text is allowed. Is there an update to the form too?
Click the button to change the value of “Format” field and then click anywhere else in the form. The problem is that when a new value is not one of the options (like in this example) it gets changed back which I don’t want to happen. I used that form sample from dhtmlxSuite Pro 4.0.3.
I think I found one solution to my problem: last_hover property is needed to set to null so that a new value is processed correctly in _confirmSelect. If there is a better solution please let me know.
dhtmlXCombo.prototype.setComboValue = function(value) {
// sets text in combobox, only text
var t = this.getOption(value);
if (t != null) {
this.selectOption(t.index);
} else {
this.conf.last_hover = null;
this.conf.last_value = value;
this.base.childNodes[1].value = this.conf.last_value;
this.base.childNodes[2].value = "true";
}
};
I downloaded a fresh copy of dhtmlxSuite standard and only added that button to samples/dhtmlxForm/02_items/08_combo.html. When button is clicked the value of format field is correctly changed to WMA but when e.g. project name field is clicked afterwards format is changed back to AC3.
I will use it but I also hope that you are able to reproduce this because otherwise I would need to fix this every new version you may release.