Jump to content

Recommended Posts

Posted

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,

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...