Page 2 of 2

Re: How to put dynamically created frame into JQLayout

PostPosted: 13 Mar 2018 18:27
by Jorge Sousa
Hi

About

It seems to me that in general, if I have an async event (lets say for a button click) and I change properties of another component I would often have to call RenderAsync. Otherwise, how would the button click event know which other controls to re-render? Is that correct? i.e. if I use a button click to populate the items in a listbox or something


You must use only RenderAsync or AjaxReRender = RenderAsync(...,Self)

When

What happens sometimes is that:

Javascript is not generated because the operations are too complex, that's why render async is a good thing, because it renders the html of a region and its children and then uses javascript to add/replace the html to the current page.

for some jquery plugins the javascript is generated, and the plugin had a general setter method, but it doesn't do anything for a given property (is the case of jqgrid column's width).



So the rule is: only user RenderAsync when strictly necessary, ie, if the code you add in an async event its not reflected in the browser.

Re: How to put dynamically created frame into JQLayout

PostPosted: 13 Mar 2018 21:31
by davenovo
Makes sense, thanks.

You may want to put an edited version of this information in the

https://www.cgdevtools.com/cgforum/viewforum.php?f=5

forum as a help to others.

Re: How to put dynamically created frame into JQLayout

PostPosted: 15 Mar 2018 21:10
by zsleo
So the rule is: only user RenderAsync when strictly necessary, ie, if the code you add in an async event its not reflected in the browser.


The problem with this approach is that is programming by "trial and error"

Re: How to put dynamically created frame into JQLayout

PostPosted: 16 Mar 2018 10:55
by Alexander Bulei
Hi zsleo,

The problem with this approach is that is programming by "trial and error"


Almost all the plugin options (which are under the specific property, e.g: DatePickerOptions, DropDownOptions..) support async change.

All other actions, require AjaxReRender.

Best Regards.

Re: How to put dynamically created frame into JQLayout

PostPosted: 16 Mar 2018 18:28
by zsleo
Alexander,
The philosophical problem with "almost all" is that when you use something that isn't in the "almost all" category it becomes "programming by trial and error".

This is when documentation is all important.

Please don't treat this as a personal issue. It is meant by me with the best intention.