NetTalk Central

Author Topic: Change defaut Browse Layout Method on the fly?  (Read 1768 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 341
    • View Profile
    • Email
Change defaut Browse Layout Method on the fly?
« on: January 23, 2025, 12:08:16 PM »
Hi All
NT 14.16  C11
I am trying to give the user the option to display browses and forms in Table or in Flexbox. (As an old guy, I like to see things in tables and they make more sense) - so, I vote for Tables and if I am going to look at them on a mobile device, I will turn the display to horizontal to see the whole table width.   The young kids consume their web data differently and like the flex box display. 
So, I know that I can set the defaults in Web Server and it sets: 
s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Table   [for Tables]
  s_web._SitesQueue.Defaults.BrowseLayoutMethod = Net:Table
and
s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Div   [for flex grid]
  s_web._SitesQueue.Defaults.BrowseLayoutMethod = Net:Div
  s_web._SitesQueue.Defaults.ChildrenLayoutMethod = Net:Div

Each procedure calls a local layout method which is either from the  SitesQueue:
  loc:LayoutMethod =  p_web.site.BrowseLayoutMethod
or is set at the procedure level something like:
   loc:LayoutMethod =Table

I want to give each user the ability to use the Table or FlexGrid option to view their data - I anticipate giving them a default setting on login or run-time.

QUESTION:  What is the easiest way to do this?

I may be able to replace the value of  s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Table    with s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Div and give the user a choice.  Is that a good idea or will this change it for all users?  I think it will change it for only the current session but I am not certain about that.

I could also trap the s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Div  at the procedure level and replace that with a Session Value that I have set.  I would have to do this for each procedure.

Any Thoughts?
Thanks,
Ron

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11275
    • View Profile
Re: Change defaut Browse Layout Method on the fly?
« Reply #1 on: January 28, 2025, 11:11:40 PM »
>> The young kids consume their web data differently and like the flex box display. 

Or a Grid display.

>> so, I vote for Tables and if I am going to look at them on a mobile device, I will turn the display to horizontal to see the whole table width. 

You should rather use Grid layout, and use different CSS for one option or the other. But that's perhaps a question for another thread;

>>  s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Table    with s_web._SitesQueue.Defaults.FormLayoutMethod = Net:Div and give the user a choice.  Is that a good idea or will this change it for all users?

That would change it for all users. s_web is the server object, and there's only one of those.
But the NetWebForm doesn't use s_web._SitesQueue.Defaults.FormLayoutMethod, it uses p_web.site.FormLayoutMethod
p_web.site.FormLayoutMethod is primed with the value in s_web._SitesQueue.Defaults.FormLayoutMethod, but you can change it if you like. I recommend in WebHAndler in the ProcessLink method, before the parent call.

Cheers
Bruce