ice Posted February 12, 2018 Share Posted February 12, 2018 How can use a colorpicker in UniDBGrid like ComboBox. Quote 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, Quote 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 Quote 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 Quote 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)); } } ); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.