dgrid alternating row color and selection mixin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

dgrid alternating row color and selection mixin

Michael Schall

Here is a plunker showing the issue: http://plnkr.co/edit/Bb30hFxBVHhJIBMyICqs?p=info

dgrid alternating row color and selection in 1.0

I am trying to get alternating row colors working with the selection extension. I found a link here suggesting the way to do this is with a .dgrid-row-odd:

.dgrid-row-odd {
background: #F2F5F9;
}

However if you are using a skin (i.e. claro) the coloring does not have enough specificity due to a rule in the claro.css file:

.claro .dgrid-row {
background: #fff url("images/row_back.png") repeat-x;
...
}

This can be resolve by adding your skin name to the rule above:

.claro .dgrid-row-odd {
background: #F2F5F9;
}

This however causes issues if you are using the selection mixin. The rule for selection background color is defined in the claro.css at the same specificity of the the alternating row color.

.claro .dgrid-selected {
background-color: #cee6fa;
}

Since the alternating row color is defined later in the document, it wins causing selected odd rows that are not being hovered to not show as selected.

Adding a !important to the dgrid's claro rule above does resolve the issue.

Am I missing an option that does not require a dgrid change?

Thanks

Mike


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: dgrid alternating row color and selection mixin

Simon Walter


On 2016/02/24 8:03, Michael Schall wrote:

Here is a plunker showing the issue: http://plnkr.co/edit/Bb30hFxBVHhJIBMyICqs?p=info


...

Am I missing an option that does not require a dgrid change?



I am not sure, but I can confirm that I have the same behavior when using the selection mixin. It seems like a bug in the css ordering as you pointed out.

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: dgrid alternating row color and selection mixin

Michael Schall
We have made a copy of the claro.styl file as we have a different color scheme so I modified our copy with a potential solution.  Hopefully this can be fixed in dgrid so others won't have the same issue.  

I added !important to the selected rules in our skin and recompiled the css.  Here are my changes:

$dgrid-selected-background-color ?= #aaa !important;
$dgrid-selected-hover-background-color ?= #888 !important;


On Tue, Feb 23, 2016 at 6:58 PM, Simon Walter <[hidden email]> wrote:


On 2016/02/24 8:03, Michael Schall wrote:

Here is a plunker showing the issue: http://plnkr.co/edit/Bb30hFxBVHhJIBMyICqs?p=info


...

Am I missing an option that does not require a dgrid change?



I am not sure, but I can confirm that I have the same behavior when using the selection mixin. It seems like a bug in the css ordering as you pointed out.

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest