Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Colour Picker
-
- Posts: 25
- Joined: Thu Jun 23, 2011 6:08 am
Colour Picker
Hi.
I'm new to nuBuilder and am very pleased with what I have seen so far.
And a great Australian product : )
Can someone please offer some example code or instructions on how to pick a colour in a control on an edit form.
Store the colour in a field of that record.
Then display individual rows on the browse from in the colour the user has selected.
Thank you for your help.
I'm new to nuBuilder and am very pleased with what I have seen so far.
And a great Australian product : )
Can someone please offer some example code or instructions on how to pick a colour in a control on an edit form.
Store the colour in a field of that record.
Then display individual rows on the browse from in the colour the user has selected.
Thank you for your help.
Re: Colour Picker
FBC-Tim,
I didn't quite understand your question.
Did you mean something like this..?
And can you explain again how you want to use the browser.
Steven
I didn't quite understand your question.
Did you mean something like this..?
And can you explain again how you want to use the browser.
Steven
You do not have the required permissions to view the files attached to this post.
-
- Posts: 25
- Joined: Thu Jun 23, 2011 6:08 am
Re: Colour Picker
Thanks for your reply.
I want to be able to select a colour like the image you have posted (looks good).
Would be nice to have some type of dropdown that allows them to pick from about 10 suitable pre-set colours that will show ok on the background.
Then store the hex value of that colour in the database record.
When that record is shown in the list on the browse window I would like the text of each record to be in the colour the user selected for that record.
So the user can see the colours they have chosen to indicate different status types for each record.
Thank you for taking the time to consider my request
I want to be able to select a colour like the image you have posted (looks good).
Would be nice to have some type of dropdown that allows them to pick from about 10 suitable pre-set colours that will show ok on the background.
Then store the hex value of that colour in the database record.
When that record is shown in the list on the browse window I would like the text of each record to be in the colour the user selected for that record.
So the user can see the colours they have chosen to indicate different status types for each record.
Thank you for taking the time to consider my request

Re: Colour Picker
If you create a table called colour.
Add a a field called col_colour (as well as a Primary Key)
Create a form for it..
then put CONCAT("<span style='background-color:",col_colour,"'>",col_colour,"</span>")
in the display part of for the browse ..
You should get this..
I hope this helps.
Steven
Add a a field called col_colour (as well as a Primary Key)
Create a form for it..
then put CONCAT("<span style='background-color:",col_colour,"'>",col_colour,"</span>")
in the display part of for the browse ..
You should get this..
I hope this helps.
Steven
You do not have the required permissions to view the files attached to this post.
-
- Posts: 25
- Joined: Thu Jun 23, 2011 6:08 am
Re: Colour Picker
Thanks a lot.
Got that to work nicely : )
Any way to make the full width of the field coloured on the browse screen?
Tried to use a div with background-color set instead of the style but the resulting div was squashed flat and did not show the text.
Got that to work nicely : )
Any way to make the full width of the field coloured on the browse screen?
Tried to use a div with background-color set instead of the style but the resulting div was squashed flat and did not show the text.
Re: Colour Picker
Try..
CONCAT("<span style='width:1000;background-color:",col_colour,"'>",col_colour,"</span>")
(or whatever)
this is HTML style sheet stuff, bot really nuBuilder.
Steven
CONCAT("<span style='width:1000;background-color:",col_colour,"'>",col_colour,"</span>")
(or whatever)
this is HTML style sheet stuff, bot really nuBuilder.
Steven
-
- Posts: 25
- Joined: Thu Jun 23, 2011 6:08 am
Re: Colour Picker
My colour lookup looks like the image I have attached below, thanks for your help on this, it looks great : )
I have found that when I try and use the PRINT button to print a browse list that has the CONCAT(...) in the Display field it throws an error as shown below.
How is it possible to print when the Display field has been enhanced to show the colour?
You may need to clarify one more thing for me please.I have found that when I try and use the PRINT button to print a browse list that has the CONCAT(...) in the Display field it throws an error as shown below.
How is it possible to print when the Display field has been enhanced to show the colour?
An error has occurred while running this query. Please contact technical support and quote error reference: fad1fd7.
The following information is only provided for users logged on as globeadmin.
SQL
SELECT CONCAT('<span style='width:150;background-color:',colour_data,''>',colour_name,'</span>') FROM colour ORDER BY colour_name
Error
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'width:150;background-color:',colour_data,''>',colour_name,'</span>') FROM colour' at line 1
You do not have the required permissions to view the files attached to this post.
Re: Colour Picker
FBC-Tim,
I don't think your single quotes and double quote match up correctly.
Steven
I don't think your single quotes and double quote match up correctly.
Steven
-
- Posts: 25
- Joined: Thu Jun 23, 2011 6:08 am
Re: Colour Picker
I agree.admin wrote:I don't think your single quotes and double quote match up correctly.
Steven
In the Display part of the browse i have this string:
(I have highlighted the double quotes in red and left the single quotes balck)
CONCAT("<span style='width:150;background-color:",colour_data,"'>",colour_name,"</span>")
In the error screen shown when I press the PRINT button:
(All the double quotes have been translated to single quotes)
SELECT CONCAT('<span style='width:150;background-color:',colour_data,''>',colour_name,'</span>') FROM colour ORDER BY colour_name
This is also shown further down the page - it may help as it clearly shows what is happening to the single and double quotes.
Code: Select all
[tra_message] => $TRAP_sql='SELECT CONCAT(\'<span style=\'width:150;background-color:\',colour_data,\'\'>\',colour_name,\'</span>\') FROM colour ORDER BY colour_name'; $TRAP_b4sql=''; $TRAP_col='150,c,Colour,~'; $TRAP_cnt='1'; $TRAP_tmp='___nu14e0a69f1bb4f7___';
Maybe I have a setting wrong in my PHP or something like that?
Is there a way to have a different Display string for the Browse? One for on screen, with the colours, and one for printing, with regular text only?
Re: Colour Picker
It seems you have found a bug!
You'll have to work around it til our next release.
Sorry about that
Steven
You'll have to work around it til our next release.
Sorry about that
Steven