How to draw borders between cells in react-virtualized Table - react-virtualized

I am using Table component from react-virtualized to render a dataset of 1,000 rows and 20 columns. Even after reading documentation for Table and Column and after a few experiments, I am not able to draw borders between cells in my Table.
Examples from react-virtualized with borders include only Grid component, such as Grid and CellMeasurer.
It think that Grid has a different implementation of cells than Table which appears to use flexboxes? Notice in the images below that a cell "content" in Grid occupies whole cell whereas in Table only a portion.

The Table component uses flexbox layout so you can still do what you're aiming for, using flex styles.
For example, you can specify a rowStyle={{alignItems: "stretch"}} so that the columns fill the full height of the row. Then if you want to vertically center column text, you can specify a Column prop style={{display: "flex", alignItems: "center"}}.
(The same can also be done with CSS classes of course.)

This should more or less get you what you need, although this may not be the correct way to override. I just started working with react-virtualized yesterday so I'm still toying around with things.
#border: 1px solid #D3D3D3;
.column() {
align-items: center;
border-right: #border;
display: flex;
flex: 1;
height: 100%;
min-width: 0;
&:last-child {
border-right: none;
}
}
/*** Overrides for react-virtualized styles ***/
.ReactVirtualized__Table__Grid {
background-color: white;
border-bottom: #border;
border-right: #border;
}
.ReactVirtualized__Table__headerColumn {
.column();
}
.ReactVirtualized__Table__headerRow {
background-image: linear-gradient(#fff, #efefef);
border: #border;
padding-right: 0 !important;
}
.ReactVirtualized__Table__row {
border-bottom: #border;
border-left: #border;
}
.ReactVirtualized__Table__rowColumn {
.column();
}

Related

how to make a header responsive and keep svg at center?

Hi all I already have it looking centered and responsive but I am not sure if there is anything else I can do to make it even better
I have this structure:
div
div
svg
the first div has
width 100%
second has
display flex
align items center
then for the svg I have it's size:
svg[Attributes Style] {
width: 85;
height: 21;
}
What else can I do? I am testing it in various screens but I haven't found issues yet.
Try this
div div { ## this is the second <div> tag
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
and
svg {text-align: center;}

Styled Components: Override Styles not working correctly with Server Side Rendering

It seems like overriding styles does not work consistently. I have this two styled components:
const StreamContentContainer = styled.div`
display: flex;
vertical-align: middle;
flex-direction: column;
flex: 0 100%;
align-items: center;
flex-wrap: wrap;
padding: 1rem;
flex-flow: column wrap;
`;
// new Component based on StreamContentContainer
with additional styles and override stlye
const FullStreamContentContainer = styled(StreamContentContainer)`
height: 56.11vw;
overflow: hidden;
padding: 0;
`;
Know if I use my FullStreamContentContainer there should be no padding. On CSR that works fine, the element shows up in the markup correctly.
But if the element is requested initial with SSR the padding of the StreamContentContainer overrides the FullStreamContentContainer again.
It does not matter if the node is generated on SSR or CSR, it shows up the same way in the markup:
<div class="sc-4y67w2-1 fodYop sc-4y67w2-0 WzHos">...</div>.
But if I inspect the element with the DevTools, I can see that on SSR first the class WzHos shows up and then the class fodYop:
Compared to the rules rendered on CSR the rules occur the other way round - like expected:
Does anybody know what causes this weird behavior and how to avoid it?
Problem resolved: Increased the specificity of FullStreamContentContainer styles by using
const FullStreamContentContainer = styled(StreamContentContainer)`
&&& {
height: 56.11vw;
overflow: hidden;
padding: 0;
}
`;
Relating to the SC docs, the repeated class bumps the specificity high enough to override the source order.

How to increase the size (thickness) of a vaadin progressbar

How am i able to increase the height(thickness) of a vaadin progressbar- 7.6.3. And also how can i display the values which are progressed. For example in the middle of a progressbar showing how much is done and how much is remaining. I have tried with the following code but it is always the default size.
_progress.setWidth("100%");
_progress.setHeight("100%");
and also i tired using css, something like,
_progress.setCaption(" ");
_progress.setCaptionAsHtml(true);
_progress.addstylename("progress");
where ".progress" i have defined in my .css with
.progress1 {
color: black;
text-align: right;
font-size: 2em;
font-weight: bold;
height: 100%;
}
Instead of defining a style just for your progress bar, you have to include the wrapper to your style rule.
.v-progressbar-fat .v-progressbar-wrapper {
height: 20px;
}
If you add this to your style sheet and apply the style name "fat" to your progress bar, it's height will be changed to 20px (Or whatever amount you wish)

filtering not working after pointing filterStyleClass to a function primefaces

Hi guys im trying to add a delete icon in my filter. So i use filterStyle class to point to a function. and it works fine i see the icon when i click it the field clears. However the filter doesnt filter anything when im trying to search.<style>
span.deleteicon {
position: relative;
}
span.deleteicon span {
position: absolute;
display: block;
top: 5px;
right: 0px;
width: 16px;
height: 16px;
background: url('http://cdn.sstatic.net/stackoverflo/img/sprites.png?v=4') 0 -690px;
cursor: pointer;
}
span.deleteicon input {
padding-right: 16px;
}
</style>
my function is like $('input.deletable').wrap('<span class="deleteicon" />').after($('<span/>').click(function() {
$(this).prev('input').val('').focus();
}));
and called in my filter filterStyleClass="deletable" i understand my filter uses an ajax call is this affected anyway by this.
This really doesn't look like JSF at all.
You can check out the primefaces filter example.
http://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml

css hover creating border but pushing content

Situation
I'm currently building a site and desire to have some elements create a border/outline upon hovering the mouse over them. This is simple enough to make work. For reference, please see the staging site at Stagin area link. I'm using the grid part of the latest bootstrap and the box-sizing model.
Issue
I find that upon hovering, the content below that which is being hovered gets "pushed" far down below the next element. Using the stagin area as reference, I can change the behaviour through CSS to fix this on the left hand side or the right hand side but, not both at the same time.
Code
Here is a snippet of the CSS I use to make the effect:
.hover-border:hover {
border: 3px solid #3A3A3A;
display: block;
}
Using this method, anything but the first element behaves as expected. If I try this next snippet, the first element works but, then the others break:
.hover-border:hover {
border: 3px solid #3A3A3A;
display: block;
margin-top: -6px;
}
For the sake of clarification with regard to properties inherited, I have set the margin/padding on the elements in question to '0 !important' for standard behaviour until hover
Problem
How can I stop the element below from being pushed?
Personally - I go with something along the lines of:
.hover-border {
border: 3px solid transparent;
display: block;
}
.hover-border:hover {
border: 3px solid #3A3A3A;
}
The best solution to these issues is to use the box-sizing:border box property
* {box-sizing:border-box;}
Then elements will retain whatever size you define but it will now INCLUDE borders and padding.
Another solution with less code:
.hover-border:hover{
box-shadow: inset 0 0 0 3px #3a3a3a;
}
Try This will work.
.hover-border {
border: 3px solid transparent;
display: block;
}
.hover-border:hover{
border: 3px solid #3a3a3a;
}
Or
a.no-decoration, a.no-decoration img {
border: medium none;
color: inherit;
cursor: pointer;
outline: medium none;
text-decoration: none;
display: block; /*Added*/
border: 3px solid transparent; /*Added*/
}
Borders are tough to work with when sizing is important. I found it much better to use box-shadow, which just alters the background, so takes up no size.
https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow?v=a
This will work:
.hover-border:hover {
outline: solid 4px #78CF82;
}
"Because the outline property is not a part of the element's dimensions; the element's total width and height is not affected by the width of the outline."

Resources