This topic is locked
[SOLVED]

 User Selectable Color

10/2/2018 3:38:49 PM
PHPRunner General questions
B
Boyd author

I have a user that would like to have items that are stored in a table, but to be able to select the color they are displayed in on a form or in a list. Any ideas how this might be done without writing a ton of code?

B
Boyd author 10/3/2018



See this:

https://xlinesoft.com/phprunner/docs/conditional_formatting.htm

and

https://xlinesoft.com/phprunner/docs/how_to_change_row_background_color.htm



Thanks, but that helps with view, I want to actually change it on the form and want to allow the administrator to pick the color. We have tests and each test is in a group. So I am doing a custom SQL query to make a TestByGroup column. That is what I am displaying in the form and sorting it so that each test group is together. I would like to color code each of the test groups by an admin selected color so when the user goes in, they see the different test groups by color. The customer would actually like to use an expandable list by group so that the user clicks on a group and it expands to show all the tests under that group. But can't do that without a lot of custom coding that the customer doesn't want to have me spend the time doing.

W
WilliamBDevClub member 10/4/2018



Thanks, but that helps with view, I want to actually change it on the form and want to allow the administrator to pick the color. We have tests and each test is in a group. So I am doing a custom SQL query to make a TestByGroup column. That is what I am displaying in the form and sorting it so that each test group is together. I would like to color code each of the test groups by an admin selected color so when the user goes in, they see the different test groups by color. The customer would actually like to use an expandable list by group so that the user clicks on a group and it expands to show all the tests under that group. But can't do that without a lot of custom coding that the customer doesn't want to have me spend the time doing.


You can save the color code in a session variable on successful login or pull the color code from database field and save to session variable
Then you can do something like this in after record processed to highlight.
for cell



$record["Field-name_css"]='background:'.$_SESSION["Color"].';



for row



$record["css"]='background:'.$_SESSION["Color"].';