CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Create programmatically

by cyracks » 08 Sep 2018 23:25

Hello,

I am trying to create JQMMobiScroll2 from code but it somehow does not work as expected (when edit is selected no date box popup)

Code is:
Code: Select all
var MFilterDate: TIWCGJQMMobiScroll2;

    MFilterDate := TIWCGJQMMobiScroll2.Create(WebApplication);
    with MFilterDate do begin
        Name := 'MFilter_'+nID;
        Parent := WinControl;
        TabOrder := TabOrder;
        Tag := StrToInt(nID);
        JQMCoreOptions.Mode := jqmsmMixed;
        JQMCoreOptions.Theme := jqmstJQM;
        Preset := jqmspDate;
    end;


Probably some part of the code is missing ?

Regards,
Tomaž
cyracks
 
Posts: 92
Joined: 09 Feb 2016 12:47

by Alexander Bulei » 10 Sep 2018 10:49

Hi cyracks,

When you call that code?

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by cyracks » 10 Sep 2018 12:39

The event is set on CGJQMListItem.onVClick and after objects (JQMMobiScroll2) are added to Accordion ajaxRender is called.

1) Items of CGJQMListView are added on form Create event, event CGJQMListItem.onVClick is added like:
Code: Select all
with CGJQMListItem do begin
    if Assigned(OnClick) then begin
        Events.OnVClick.OnEvent := OnClick;
        if Assigned(LockIndicator)
            then Events.OnVClick.Indicator := LockIndicator;
    end;


2) Procedure onVClick adds objects to accordion and calls AjaxReRender
Code: Select all
procedure Form.MListViewVClick( Sender: TObject; AParams: TStringList);
begin
    MFilterDate := TIWCGJQMMobiScroll2.Create(WebApplication);
    with MFilterDate do begin
        Name := 'MFilter_'+nID;

        Parent := WinControl;
        TabOrder := TabOrder;
        Tag := StrToInt(nID);
        // JQMEditOptions.PlaceHolder := cPlaceHolder;
        JQMCoreOptions.Mode := jqmsmMixed;
        JQMCoreOptions.Theme := jqmstJQM;
        Preset := jqmspDate;
    end;

    Accordion.AjaxReRender();
end;


After that I can see object JQMMobiScroll2, it just does not work after it is clicked.
cyracks
 
Posts: 92
Joined: 09 Feb 2016 12:47

by Alexander Bulei » 11 Sep 2018 11:43

Hi cyracks,

For the fast support, can you provide the simple testcase with your structure?

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by cyracks » 11 Sep 2018 23:21

Hello Aleksander,

after trying to repeat the error on a simple project I found the problem was in my code (code written above was not even executed)

Thank you for your help.

Regards,
Tomaž
cyracks
 
Posts: 92
Joined: 09 Feb 2016 12:47

by Alexander Bulei » 12 Sep 2018 18:17

Hi cyracks,

Ok, I'm glad that you have found the problem :)

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQMMobiScroll2

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.