Jump to content
uniGUI Discussion Forums
Sign in to follow this  

ClientEvents at runtime

Recommended Posts



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?

Share this post

Link to post
Share on other sites

**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();}';

Share this post

Link to post
Share on other sites


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");'
                        + '    };'
                        + '}';

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this