Jump to content


Photo

ClientEvents at runtime


  • Please log in to reply
2 replies to this topic

#1 dan602

dan602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 93 posts

Posted 07 January 2018 - 02:54 PM

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?
 

  • 0

#2 dan602

dan602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 93 posts

Posted 07 January 2018 - 02:55 PM

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


  • 0

#3 irigsoft

irigsoft

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 67 posts

Posted 07 January 2018 - 07:32 PM

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

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users