Hi,

Is there any chance that at some point FS will support the setting of the selected/alternate record colour in a grid control out of the box?

I read another post that suggests using CSS and an external Javascript call can achieve this but having to step out of the FS paradigm so to speak to edit CSS and/or Javascript is one of the major pains with APEX if you want to do certain little tweaks that should be simple and are simple in many others type of developer tool.

If would be great if the Grid control simply had a SelectedRowColour property and AlternateRowColour that could be set to some colour (either as a fixed colour from a predefined palette of named colours or using RGB values or something.

Thanks,

Craig

asked 27 Apr '13, 22:23

Craig's gravatar image

Craig
1.1k138
accept rate: 6%


Hi Craig,

No need for a javascript call to do that. Just create a custom.css file and put this in it:

.bdf-grid .bdf-grid-row-selected .x-grid3-cell-inner { background-color: lightyellow; border-color: red;

Then save the custon.css file into "apps\<your app name>\css\" folder in your Formspider middle tier installation. Then set the CSS Filename application property to "custom.css". That's all. Now you have full controll over the styling of all components.

In my opinion this is much easier then to set the colors for each and every grid in your app. If you have a specific grid you might want to style different you could also achieve this through css using the component ID.

Just my 2c.

Regards, Michiel

link

answered 28 Apr '13, 10:11

Michiel%20A's gravatar image

Michiel A
5161544
accept rate: 13%

Hi Michiel,

Thanks for your response; whilst I can see that this would work, it is still not ideal in my opinion because it means stepping outside of the development paradigm of FS.

If I have to resort to CSS to make a simple visual change such as this then there should still at least be a means of specifying a different style within the code (UI XML and API) with perhaps a "SelectedRecordStyle" and "AlternateRecordStyle" property that can be set to a named style; a reason you might want to do this is if you need to alter the style/colours dynamically based on context.

Thanks,

Craig

(28 Apr '13, 10:29) Craig

Being able to set a styleclass for Selected record and alternate record would be nice (and much better the allowing to hardcode colors in my opinion).

About setting a style/color based on record content: you can currently do it by referring a grid component to a backgroundColorColomn named in the datasource (a column in the datasource which holds the named or RGB color code). If you would want the whole row to have this backgroundcolor, then you would have to set the property for all columns.

Best, Michiel

(28 Apr '13, 10:50) Michiel A

I agree, setting to a style rather than a specific colour is better than a hardcoded colour. The ability to do it via an API would be good because you could do it for any event for almost any context/condition such as a user driven parameter, the value in another datasource...etc.

(28 Apr '13, 12:27) Craig

Duly noted.

(29 Apr '13, 03:42) Yalim ♦♦

Hi,

I tried the method above and got it working so thanks for that.

However, I've still not found a way to specify the colour to use for alternate records, i.e. odd records are plain and even records are a different colour (recording banding). How can I achieve this in FS?

Thanks,

Craig

link

answered 05 May '13, 06:53

Craig's gravatar image

Craig
1.1k138
accept rate: 6%

Hi Craig,

That would be:

.x-grid3-row-alt .x-grid3-cell-inner { background-color: red; }

Best, Michiel

(05 May '13, 06:59) Michiel A

Excellent, thanks Michiel :)

(05 May '13, 07:30) Craig
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×32
×14

Asked: 27 Apr '13, 22:23

Seen: 1,498 times

Last updated: 05 May '13, 07:30


© Copyright Gerger 2017