Wicket Posted January 7, 2018 Share Posted January 7, 2018 Hi, On the create of all of my forms I have a function which loops over controls to find all UniDBGrids, so I can have one function that sets up the grids, so they are all the same. Is it possible to hook up ClientEvents at runtime, eg AGrid.ClientEvents.UniEvents := xxx I want to be able to hook up to Ext.toolbar.Paging [pagingBar] function pagingBar.afterCreate(sender) { sender.items.items[10].hide(); //hide refresh button } This will allow me to add this in one place, rather than 50 odd forms. Is this possible? Quote Link to comment Share on other sites More sharing options...
Wicket Posted January 7, 2018 Author Share Posted January 7, 2018 **edit ignore this post - posted in haste** I have just seen the client demo - UniEdit1.ClientEvents.ExtEvents.Values['change']:='function(sender, newValue){UniClientEventsDynamicClient.UniEdit2.setValue(newValue)}'; if anyone does come across this I can confirm this works, AGrid.ClientEvents.UniEvents.Values['pagingBar.afterCreate']:='function pagingBar.afterCreate(sender){sender.items.items[10].hide();}'; Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 7, 2018 Share Posted January 7, 2018 Hi, I dinamically create components TuniButton, and set "resize" function: TuniButton (NewComponent).ClientEvents.ExtEvents.Values['resize'] := 'function resize(sender, width, height, oldWidth, oldHeight, eOpts)' + '{' + ' var me = sender.btnInnerEl;' + ' var tm = new Ext.util.TextMetrics();' + ' var lineHeight = parseInt(me.getStyle("line-height"));' + ' if (tm.getSize(sender.text).width >= width + 10)' + ' {' + ' Ext.defer(function() {' + ' me.setStyle("line-height", lineHeight / 2 + "px");' + ' me.setStyle("white-space", "normal");' + ' }, 50);' + ' }' + ' else' + ' {' + ' me.setStyle("white-space", "nowrap");' + ' };' + '}'; 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.