This topic is locked

Show/hide columns, initial state

1/16/2019 10:15:45 AM
PHPRunner General questions
A
aalekizoglou author

I have set allow show/hide fields on page. Is there a way I can set up the initial state of fields shown before the user select which fields to hide?

A
aalekizoglou author 1/16/2019



https://asprunner.co...-addedit-pages/


Well, this is how to hide fields on pages with javascript.
What I am asking is...

On PHPR->Fields page I can set which fields will be available on List page and shown initially once the user enters that list page for the first time. Then the user can select to hide some columns, and those preferences will be stored to the DB. What I want is to have some of those columns initially hidden, then the user can select to show/hide based on the available fields.

S
steveh 1/22/2019



What I am asking is...

On PHPR->Fields page I can set which fields will be available on List page and shown initially once the user enters that list page for the first time. Then the user can select to hide some columns, and those preferences will be stored to the DB. What I want is to have some of those columns initially hidden, then the user can select to show/hide based on the available fields.


There's no easy way to intercept this without doing some code changes, the routine you need to look at is this:-
protected function setGridUserParams() in classes/listpage_simple.php
Regards

Steve
In fact, your easiest way would be to preload the table that all the settings are saved in if there wasn't already a record there for that user/device.

A
aalekizoglou author 1/22/2019



There's no easy way to intercept this without doing some code changes, the routine you need to look at is this:-
protected function setGridUserParams() in classes/listpage_simple.php
Regards

Steve
In fact, your easiest way would be to preload the table that all the settings are saved in if there wasn't already a record there for that user/device.


Preloading the table was my first thought... But I will investigate the setGridUserParams() idea as well