Hayri ASLAN Posted December 2, 2015 Posted December 2, 2015 Hi, in this example we are seeing 2 button on top of grid. http://dev.sencha.com/ext/5.1.0/examples/grid/row-editing.html when we look the source we can see that buttons adding to tbar. I tried to get this but couldn't. How can i add buttons to tbar? Quote
Sherzod Posted December 2, 2015 Posted December 2, 2015 Hi, If I correctly understood you, a simple example, try: UniDBGrid1 -> ,,, function beforeInit(sender, config) { sender.tbar = [{ text: 'Add Employee', //iconCls: 'your icon class', handler : function() { alert("Add Employee"); //your logic } }] } Best regards. 1 Quote
Hayri ASLAN Posted December 2, 2015 Author Posted December 2, 2015 Delphi Developer Thank you so much. Quote
Freeman35 Posted January 26, 2018 Posted January 26, 2018 Hello, I get some question, 1- How can I change disabled true/false of itemid: '_Edit' in runtime (delphi) 2- How can change text font's property / css not change I couldn't find that 3- How can I change heigth of tbar. default is auto, I wanna add more space buttom of button (need for shadow) Thank you function beforeInit(sender, config) { sender.tbar = [{ disabled: true, itemId:'_Edit', text: 'Add Employee', //iconCls: 'your icon class', handler : function() { alert("Add Employee"); //your logic } }] } Quote
Sherzod Posted January 26, 2018 Posted January 26, 2018 Hello, 1- How can I change disabled true/false of itemid: '_Edit' in runtime (delphi) One possible solution, try this: Enable: UniDBGrid1.JSInterface.JSCode('var item='#1'.query("[itemId=_Edit]")[0]; if (item){item.setDisabled(false)};'); Disable: UniDBGrid1.JSInterface.JSCode('var item='#1'.query("[itemId=_Edit]")[0]; if (item){item.setDisabled(true)};'); Quote
Freeman35 Posted January 26, 2018 Posted January 26, 2018 Thnak you, another perfedt solution, I hope you have solution for 2. & 3. question too regrads Quote
Sherzod Posted January 27, 2018 Posted January 27, 2018 Hello, 2- How can change text font's property / css not change I couldn't find that 3- How can I change heigth of tbar. default is auto, I wanna add more space buttom of button (need for shadow) Please, can you explain a little more what you wanted ?! Quote
Freeman35 Posted February 20, 2018 Posted February 20, 2018 Hi, You can see on screenshot. I wanna change button's color to white and make bold, sometime change font name etc. I wanna change button's parent height. for example. On screenshot. I added empty (button without caption string and "sender.tbar = [ {disabled: true, height:33, width: 1} ,") then other buttons height can be small. This fake button set toolbar panel's height. Can I set this different way? Thank you. Quote
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.