This topic is locked

List Page Both Horizontal / Vertical View

4/10/2012 3:25:29 AM
PHPRunner General questions
C
ckapote author

Hi ,
i was wondering , in a list page sometimes i need to have it in horizontal view and other in vertical view .
I was thinking to create a custom view of same list page one in horizontal and one in vertical but i do not know how

to have a button lets say on Horizontal view with Label 'Click to Change to Vertical View' and by clicking it to open the other custom view ,

the vertical one and keep the filtered data used in Horizontal .
same to apply in vertical to change to horizontal .
pls advise any thoughts
thanks

C
cgphp 4/10/2012

Add a custom button to the horizontal view, and in the "Client After" tab enter the following code:

location.href = "verticalviewname_list.php";


Replace verticalviewname with the name of the vertical view.

C
ckapote author 4/10/2012

thank you Cristian .
Tested but shows all the records when changin from one view to other .
Is it possibly to keep the advanced filter settings when changing views?
thanks



Add a custom button to the horizontal view, and in the "Client After" tab enter the following code:

location.href = "verticalviewname_list.php";


Replace verticalviewname with the name of the vertical view.

C
cgphp 4/10/2012

What do you mean for "shows all the records when changin from one view to other"?

C
ckapote author 4/10/2012

I mean that if for example I filter the records using the Advanced Search in one view lets say the horizontal and see the filtered records then i click the button and I see in Vertical view all the records in the table and not listed in the filtered view.
thanks



What do you mean for "shows all the records when changin from one view to other"?

C
cgphp 4/10/2012

To keep the searched values across the pages, use the advanced search session variables: http://xlinesoft.com/phprunner/docs/phprunner_session_variables.htm

C
ckapote author 4/10/2012

thanks i tried that but is not working
location.href =$_SESSION["Copy_of_tblwebalbum_list.php_search"];



To keep the searched values across the pages, use the advanced search session variables: http://xlinesoft.com/phprunner/docs/phprunner_session_variables.htm

C
cgphp 4/10/2012

You can't mix js code with php code.
In the Sever tab:



$result['redirection'] = $_SESSION["Copy_of_tblwebalbum_list.php_search"];


In the "Client After" tab:

location.href = result['redirection'];
C
ckapote author 4/10/2012

thanks but is not working i press the button and only refreshing the page .
i checked named of table and is correct



You can't mix js code with php code.
In the Sever tab:



$result['redirection'] = $_SESSION["Copy_of_tblwebalbum_list.php_search"];


In the "Client After" tab:

location.href = result['redirection'];


C
cgphp 4/10/2012

Wait... location.href is only a redirection...

You have to filter the records using the "Before SQL query" event and the session variables.

C
ckapote author 4/10/2012

if you can make it clear i would appreciated it
thanks in advance



Wait... location.href is only a redirection...

You have to filter the records using the "Before SQL query" event and the session variables.