3.2.0

Can the selector color be set?

In version 1.0, it was possible to set alignment and color with a CSS style.

I'm now trying to test this in version 2.0 but it appears I can't set the color.

Is this possible?
Anthony
February 6,
OK,

I can answer this myself. This works -

obj.setSelectorVisible(true)
obj.setSelectorWidth(30)
obj.setSelectorText(function(r){return fix(this.getRowPosition(r)+1)})
obj.defineSelectorProperty("color")
obj.setSelectorColor(function(){return "red"})
obj.getSelectorTemplate().setStyle("color", function(){
return this.getSelectorProperty("color")})

I can't quite get the selector numbers to be right-aligned yet but I'll post the solution if I find it.
Anthony
February 7,
This code makes sense if you want to assign dynamic/calculated color, so you need a function. Otherwise you can just use -

obj.getSelectorTemplate().setStyle("color", "red");
Alex (ActiveWidgets)
February 7,
Hi Alex,

Yes, I've also fixed the selector's text alignment so my code is now simply -

...
obj.setSelectorText(function(r){return this.getRowPosition(r)+1})
obj.getSelectorTemplate().setStyle("color", "red")
obj.getSelectorTemplate().setStyle("text-align", "right")

Thanks.
Anthony
February 7,

This topic is archived.

See also:


Back to support forum