ice Posted February 12, 2018 Share Posted February 12, 2018 How can use a colorpicker in UniDBGrid like ComboBox. Link to comment Share on other sites More sharing options...
Sherzod Posted February 12, 2018 Share Posted February 12, 2018 Hi, Maybe this post can help you: http://forums.unigui.com/index.php?/topic/9122-tunidbgrid-color-combo/ Best regards, Link to comment Share on other sites More sharing options...
ice Posted February 12, 2018 Author Share Posted February 12, 2018 Thanks, but i can't find change and focus in UniComboBox1 -> ClientEvents -> ExtEvents UniGui Ver: 1.0.2.1434 Link to comment Share on other sites More sharing options...
Sherzod Posted February 13, 2018 Share Posted February 13, 2018 Hi, Ok, I will check Link to comment Share on other sites More sharing options...
Sherzod Posted February 13, 2018 Share Posted February 13, 2018 Hi, Thanks, but i can't find change and focus in UniComboBox1 -> ClientEvents -> ExtEvents UniGui Ver: 1.0.2.1434 You can try to add these events in function afterCreate: function afterCreate(sender) { sender.addListener( 'change', function(sender, newValue, oldValue, eOpts) { var element = sender; var inputEl = element.inputCell.child('input'); var data = element.getStore().findRecord(element.valueField, newValue); if (data) { inputEl.applyStyles('padding-left:42px'); var parent = inputEl.parent(), spanDomEle = parent.child('span'); if (!spanDomEle) { Ext.DomHelper.insertFirst(parent, { tag: 'span', html: ' ' }); var newSpanDomEle = parent.child('span'); newSpanDomEle.applyStyles('background-color: ' + getHexa(data.get(element.displayField)) + ';float: left; position: absolute; top: 0.9px; margin: 3px 2px 2px 4px; width: 33px; height: 15px;'); } else { spanDomEle.applyStyles('background-color:' + getHexa(data.get(element.displayField))); } } } ); sender.addListener( 'focus', function(sender, e, eOpts) { var parent = sender.inputCell.child('input').parent(), spanDomEle = parent.child('span'); if (spanDomEle) { spanDomEle.applyStyles('background-color:' + getHexa(sender.value)); } } ); } Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now