Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi,
I have collection widget with some data in it. Now I want to highlight the selected row mashup by enlarging content in it.
Could anyone help on this ?
Thanks,
VR
Solved! Go to Solution.
You can use a CSS transform to get this. The selected cells get a class called `BMCollectionViewCellSelected` that you can make use of to apply styles specifically to the selected cells.
Note that the root cell element, with the .BMCollectionViewCellWrapper class already has a transform property that you shouldn't override, because it controls the positioning of the cells. Instead, you should target the first (and only) child element of that and apply the transform there.
Additionally, because you want to enlarge the content, you need to make sure it doesn't get clipped by the parent's box so you should set its overflow property to visible to prevent this.
If you are using the background styles, border radiuses or box shadows they will be applied to the outer cell wrapper element which doesn't get zoomed so you should use the CSS rules to apply those to the inner element.
Finally, to properly scope this to a specific collection view, use the custom class property and write your rules using it.
An example of what I described is below:
.MyCollectionViewClass .BMCollectionViewCellWrapper {
overflow: visible !important;
}
.MyCollectionViewClass .BMCollectionViewCellSelected > div {
background-color: white !important;
border-radius: 4px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, .1);
transform: scale(1.2);
}
Hi @Velkumar.
Can you provide an example of this, possibly from another website? We're not clear on your need.
Regards.
--Sharon
You can use a CSS transform to get this. The selected cells get a class called `BMCollectionViewCellSelected` that you can make use of to apply styles specifically to the selected cells.
Note that the root cell element, with the .BMCollectionViewCellWrapper class already has a transform property that you shouldn't override, because it controls the positioning of the cells. Instead, you should target the first (and only) child element of that and apply the transform there.
Additionally, because you want to enlarge the content, you need to make sure it doesn't get clipped by the parent's box so you should set its overflow property to visible to prevent this.
If you are using the background styles, border radiuses or box shadows they will be applied to the outer cell wrapper element which doesn't get zoomed so you should use the CSS rules to apply those to the inner element.
Finally, to properly scope this to a specific collection view, use the custom class property and write your rules using it.
An example of what I described is below:
.MyCollectionViewClass .BMCollectionViewCellWrapper {
overflow: visible !important;
}
.MyCollectionViewClass .BMCollectionViewCellSelected > div {
background-color: white !important;
border-radius: 4px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, .1);
transform: scale(1.2);
}