NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on June 13, 2013, 02:46:11 AM
-
Hi Everyone,
Please can anyone help? I have a drop down that display a list of names that is got from another table. All this works fine but now I want each of the names text in the dropdown to display the names in the colour assigned to the name in a configuration file that I have.
Thank you.
-
This gets tricky. Doable, but hard to describe.
Maybe post a small example, with some sample data, and I'll see what I can do.
cheers
Bruce
-
Hi Bruce,
I have attached an example app which I have modified the customer table to include colour for each customer from the customer form. Also attached to the index page is a button to call up a memory form which has the dropdown list of the customers but would like the customer names to be displayed with their colour settings from their file.
Thanks
[attachment deleted by admin]
-
You'll need build 7.12 to make this a bit easier.
In the DropListForm procedure, Value::MydropList routine, inside the loop, I set
loc:extra = 'style="color:' & clip(CUS:CustomerColour) & ';"'
(see attached pic).
Note that the color in your database is already in web format. If it was in Clarion format I would have used;
loc:extra = 'style="color:' & p_web.ColorWeb(CUS:CustomerColour) & ';"'
In some cases you might have a background color instead of a forground color;
loc:extra = 'style="background-color:' & clip(CUS:CustomerColour) & ';"'
and, if you are setting the background-color, and you want something a little bit more interesting, then set the CSS for the Drop field - set the "Drop Part" to 'nt-grad'
Cheers
Bruce
[attachment deleted by admin]
-
Hi Bruce,
Thanks for the reply, but still can get it to work. I have added the code as you have suggested but nothing happens. I am using 7.10. Do I have to upgrade to make this work?
-
yes, you need build 7.12
-
hi bruce,
so where do i get 7.12 ? as it says on capesoft the build is 7.11
-
7.12 should be up in a little while - probably later today.
-
Okay thanks bruce !
-
Hi Bruce,
Just found out that this does not work in safari on macs. It works okay on ie and firefox.
-
yes, I agree. I've tried on our Mac and it seems to ignore the style settings for the drop-down options. Firefox on Mac is ok, Safari on windows is Ok. But Safari on mac not so much.
this seems to be a Safari issue - I found other reports of it via Google, but no resolutions. I'll dig some more but this may just be one of those things that are what they are.
cheers
Bruce