Page 1 of 1

Starting with TIWCGJQFrame

PostPosted: 26 Apr 2019 21:04
by loufeliz
Hello,

I have a basic app that uses forms and I am thinking I need to convert it to use TIWCGJQFrame's so I can drop the TFrame holding my menu, and I think the app will look nicer. I have looked at the complete demo and see it uses frames, but am looking for a simple frame demo app. I looked at the JQShedulerFrame demo, but it does not run properly .

Is there another simple demo that works. I did find a helper unit in community code and will see if I can figure things out a bit more. Once I figure thisout, I need to renew my CGDev subscription so I can install into 10.2 with IW 15.


Using XE3, IW 14.2.7, CGDev 4.1.0.50

Cheers,

Lou

Re: Starting with TIWCGJQFrame

PostPosted: 29 Apr 2019 16:16
by Alexander Bulei
Hi loufeliz,

You didn't find the plain code in JQueryDemoV3_IW14?
Something like this? :

delphi code
procedure TIWComponentForm.ShowFrame(AFrameClass: TIWCGFrameClass; AParams: TStringList);
var
IsAsync: Boolean;
begin
if not Assigned(AFrameClass) then Exit;

CGJQTabs.ActiveTab:= IWCGTabDemo;

IsAsync:= CGIsCallBackProcessing;
if IsAsync then
begin
// SINCE THE FRAME IS GOING TO BE RENDERED BY AJAX, DON'T NEED TO GENERATE AJAX RESPONSE.
CGCallBackDisableAjaxResponse;
end;
try
CreateNewFrame(AFrameClass);
FrameComp.ProcessCommand(0,AParams);
finally
if IsAsync then
begin
CGCallBackEnableAjaxResponse;
RenderRegionAsync(JQRegContainer,rramOldMethod,True);
end;

end;
end;

Best Regards.

Re: Starting with TIWCGJQFrame

PostPosted: 30 Apr 2019 06:06
by loufeliz
SimpleCGFrameDemo.zip
Hi Alexander,

After looking at that and the code for scheduler demo (couldnt get it to work), The code snippet you included in your reply is part of what make it work.
I was able to make a very simple demo that I am attaching here so that others may benefit from it.

Anyway, my simple demo derived from it , I believe, is the essence of what i am looking for. This will be an improvement in my current app where I am using TFrame to include menus across several forms. I can now just have a form with a menu in he header and just load the appropriate CGFrame.

If anyone has comments or improvements to my attached demo, please reply with corrections.

Cheers!