Jump to content
uniGUI Discussion Forums
Sign in to follow this  
RobYost

TunimLabel OnClick

Recommended Posts

I am setting an OnClick event for a TunimLabel but it is not firing.

 

Is there something basic I am forgetting?

 

 

Share this post


Link to post
Share on other sites

Hi,

 

Can you try this approach for now ?!:

 

UnimLabel1 -> ClientEvents -> UniEvents -> function afterCreate:

function afterCreate(sender) 
{
    var me = sender;
    me.element.on("tap",
        function() {
            me.fireEvent("click");
        }
    )
}

Best regards,

Share this post


Link to post
Share on other sites

I mentioned before that there is many events in mobile (cient) that doesn't fire, when Farshad will fix that?

Share this post


Link to post
Share on other sites

I mentioned before that there is many events in mobile (cient) that doesn't fire, when Farshad will fix that?

 

If they don't fire it is probably because Sencha Touch does not do that.

Share this post


Link to post
Share on other sites

Thanks that works.

 

I was creating the label at runtime, here's how I did it if anyone wants to know.

 

    while ds.EOF = False do
    begin
      lblToPay[i]         := TUnimLabel.Create(ts2);
      lblToPay[i].Parent  := ts2;
      lblToPay[i].Caption := fmtCur('0');
      lblToPay[i].Tag     := i;
      lblToPay[i].Height  := 16;
      lblToPay[i].Left    := lblHeaderToPay.Left;
      lblToPay[i].Top     := curTop;
      lblToPay[i].OnClick := UnpaidClick;
      lblToPay[i].ClientEvents.UniEvents.Clear;
      lblToPay[i].ClientEvents.UniEvents.Add
        ('afterCreate=function afterCreate(sender) '#13#10'{'#13#10'    var me = sender;'#13#10'    me.element.on("tap",'#13#10'        function() {'#13#10'               me.fireEvent("click");'#13#10'        }'#13#10'    )'#13#10'}');
      totDue := totDue + 0;
      curTop := curTop + rowHeight;
      i      := i + 1;
      ds.Next;
    end;
  • Upvote 1

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  

×