CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

New features in 1.7-2.1, some questions.

General discussion

by Jorge Sousa » 02 May 2014 10:49

What is FrameRequestFeedResize?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 02 May 2014 14:21

cgdevtools_support wrote:What is FrameRequestFeedResize?

Region size evaluator. Simple script that evaluates center region height.
javascript code
<script>
function FrameRequestFeedResize()
{
var Height = document.getElementById("FrameRequestFeed_Container_template").clientHeight;
var wRegionRequestTop_template_height = document.getElementById("wRegionRequestTop_template").clientHeight;
var wRegionScrollableContainer_template_height = Height - wRegionRequestTop_template_height;
document.getElementById("wRegionScrollableContainer_template").setAttribute("style",
"height:" + wRegionScrollableContainer_template_height.toString() + "px");
}
</script>
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 02 May 2014 14:33

Hi George

do you want us to check your javascript and tell you why it don't work and how should work?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 02 May 2014 15:28

Hi!
This script works. It executes also on browser form resize and all looks fine.
page_load_ready_scrolled_resized.png

But i can't call it in correct moment after ajax render... Here is JS break point, and render status, when CGAddJavaScriptToAjaxResponse applyes:
page_load_pause_before_call_js.png (looks like css not applied in this moment).

delphi code
RenderRegionAsync(wRegionContainer);
CGAddJavaScriptToAjaxResponse('FrameRequestFeedResize();'); // region is not completely loaded (or css not applyed for now), and my js code evaluates incorrect height
// CGAddJavaScriptToAjaxResponse('debugger; $(document).ready( function() {FrameRequestFeedResize();} );'); // not helps too...
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 02 May 2014 16:04

Hello It's seems to me that you need to bind an event to the resize of FrameRequestFeed_Container_template, eg
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 02 May 2014 16:50

It's already binded on window resize:
PageContext.AddToInitProc('$(window).bind("resize", function(){ SCResizeProcessing(); });');
javascript code
function SCResizeProcessing()
{
MainFormResize();
if (document.getElementById("FRAMEREQUESTFEEDNEWIWFRAMEREGION") != null)
{
FrameRequestFeedResize();
};
}


Also i tested: CGAddJavaScriptToAjaxResponse('alert("test"); $("#FrameRequestFeed_Container_template").bind("resize",function(){FrameRequestFeedResize() });');

I'll better make simple demo..
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 02 May 2014 17:08

Hi

I'll better make simple demo..


Yes please since we are in advanced terrain here
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 05 May 2014 10:50

Hi!
Finally i got demo, please check email.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 05 May 2014 11:00

ok
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 05 May 2014 16:11

I tested various approaches, and now i belive that ability to call JS code after async render is really required... (or any working solution)
I got another one situation with this issue.
When UI configured not only on server side. For example, some template DIVs are hidden (template div's haven't server side implementation, this divs configured with custom JS).
When region re rendered (async) this changes loss (known situation), so i need to call JS code every time after region rendered (async) to restore template div state.

Something like AjaxReRender(..., JSAfterRender:string)
Last edited by George on 05 May 2014 16:17, edited 1 time in total.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

PreviousNext

Return to General - Archive

Who is online

Users browsing this forum: No registered users and 5 guests

Contact Us.