Jump to content


Photo

TunimLabel OnClick


  • Please log in to reply
5 replies to this topic

#1 RobYost

RobYost

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 212 posts
  • LocationFlorida, USA

Posted 15 June 2017 - 02:56 AM

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

 

Is there something basic I am forgetting?

 

 


  • 0

http://unigui.mirahe.../wiki/Main_Page

Please add any utilities you think are useful. I will try to keep the wiki organized.


#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4540 posts

Posted 15 June 2017 - 05:25 AM

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,


  • 0

#3 mohammad

mohammad

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 774 posts
  • LocationKufur Kassem, Palestine

Posted 15 June 2017 - 06:20 AM

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

#4 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10137 posts

Posted 15 June 2017 - 07:04 AM

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.


  • 0

#5 RobYost

RobYost

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 212 posts
  • LocationFlorida, USA

Posted 15 June 2017 - 09:05 PM

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;

  • 1

http://unigui.mirahe.../wiki/Main_Page

Please add any utilities you think are useful. I will try to keep the wiki organized.


#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4540 posts

Posted 16 June 2017 - 02:38 AM

Thank you


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users