md-ink-ripple effect for specific row in a table - angular-material

I have a table and i want to have ink and ripple effect for specific row in the table. when i add the attribute md-ink-ripple to tr element of table, it shows the ripple for entire table. please let me know how to fix this issue.

You can add display: block; position: relative; to the row styling - but that can result in odd behavior.

Related

How to remove caption in vaadin Grid multi-selection column

When Vaadin 8 Grid is set to be multi-selection mode using setSelectionMode(SelectionMode.MULTI), a column is added on left of the Grid with a checkbox on each row.
I am OK with this selection method, but the caption of each checkbox such as "Selects row number 2" etc. is really not necessary. Is there an easy method to remove these checkbox captions?
Yes, there is a caption, but it should not be visibile. It is accessibility feature. It seems that you have something wrong with theme and styles, as this label should not be rendered in viewport. So it should not be visible, it is just for screenreaders so that blind people could use the selection. See the screenshot how DOM should look like.
I change added .v-assistive-device-only-label that has all the same rules as in .v-assistive-device-only. Now, both the check square and caption are gone, leaving a empty cell to select. I'd like to learn how to make only the check square to show up but not the caption, if possible.
You need to include label element in the css selector. As you see label is a child element of the element having .v-assistive-device-only-label class name. If you target .v-assistive-device-only-label, it the css is applied to that element and thus also the checkbox which is its child is affected too. But when you add label, the css applies only for the label which is child of .v-assistive-device-only-label
.v-assistive-device-only-label label {
position: absolute;
top: -2000px;
left: -2000px;
width: 10px;
owerflow: hidden;
}

Xpages NamePicker dialog alignment and width

<xe:namePicker id="npUserNames" for="hdnUserNames">
<xe:this.dataProvider>
<xe:dominoViewNamePicker viewName="Techs"></xe:dominoViewNamePicker>
</xe:this.dataProvider>
</xe:namePicker>
The Names in the left box of the dialog are center aligned. Same with the right (selected values) box.
I have tried text-align: left css in every possible surrounding element...The table cell, the table it is in, the surrounding div tag, the panel, the layout, the entire xpage. And the content of the namepicker dialog is still centered. How do I fix that? How can I specify the width of the dialog box?
Also, in IE11, the "X" button does not work. Nothing happens when you click it.
I'd recommend interrogating the HTML generated using your browser's developer tools to see if there's a class defined for the relevant HTML tags that you can override. If so, you can use that. If not, you may need to create your own Renderer or extension of the Name Picker to generate different HTML. That will be more complicated, but the trade-off of any framework is limited configurability at the cost of quicker development.
I'm not doing exactly what Withers suggested, but it did lead me to a solution based on a comment somewhere else.
I added a class dojo attribute and assigned a new css class to it. Only issue is that it is shifting everything in the dialog to the left...but it's ok for now.
<xe:this.dojoAttributes>
<xp:dojoAttribute name="class" value="namePickerClass">
</xp:dojoAttribute>
</xe:this.dojoAttributes>
CSS:
.namePickerClass { margin: 0 auto; width: 50%; text-align:left; border: 1px solid blue; scrolling: none;
}

How can I make a specific row unselectable in a Vaadin Grid with a mult-selection model?

I'm trying to disable the checkbox on a specific row based on some property of it's Bean (or just make the whole row generally unselectable), but I can't really see any method or property I could use to get a handle of the checkboxes on the left hand side added when using a multi-selection model or something as broad as disabling the whole row. Any thoughts on how this could be achieved, or where I should be looking?
You can use CSS to hide uncheckable rows. First set their styles using setRowStyleGenerator:
grid.setRowStyleGenerator(row -> {
boolean uncheckable = (Boolean)
row.getItem().getItemProperty("uncheckable").getValue();
return uncheckable ? "uncheckable-row" : "";
});
Then change styles in your .scss, they should look something like:
.v-grid-row.uncheckable-row td {
background: #b1b9d6 none repeat scroll 0 0;
}
.v-grid-row.uncheckable-row td:first-child {
visibility: hidden;
}
.v-grid-row.uncheckable-row.v-grid-row-selected > .v-grid-cell {
background-image: none;
border-color: #d4d4d4;
color: inherit;
text-shadow: inherit;
}
Here I hide the whole cell with checkbox (if hiding the content of td itself, user will still be available to select the row), use a different color for these rows and prevent them from being highlighted when "select all" checkbox is active. Surely, further styling is available. Since we only hide them from user, they still can be selected with grid.select() and located in grid.getSelectedRows() collection, you should filter them manually (by using some "uncheckable" property, as shown above).
It is not possible to disable checkbox on a specific row.
One solution is to use generated column and/or custom renderer.
if you are using twitter bootstrap as your responsive framework, you should be able to find that row and give it a class of ".inactive", and if that doesn't work you can always rig it but placing and absolute positioned box with a height and width of 100% inside of that row and z-index it to at least 250. That should make everything in that row un-clickable!

UI-GRID - Dynamic Row Height - Alternatives

I tried to get a cell to expand it's height dynamically.
Is there a way to adjust the height of a row(GridRow) after it is rendered?
If not, then I will try to use an expandable grid or tree in a grid.
Is it possible to display an expandable grid off a specific cell/column?
Currently I see all expandable grids/tree grids that take up the entire row below the parent.
Thanks
Add this css to your styles:
.ui-grid-viewport .ui-grid-cell-contents {
word-wrap: break-word;
white-space: normal !important;
}
.ui-grid-row, .ui-grid-cell {
height: auto !important;
}
.ui-grid-row div[role=row] {
display: flex ;
align-content: stretch;
}
You can see an answer to the same question here: https://github.com/angular-ui/ng-grid/issues/3239#issuecomment-91045267
UI-Grid virtualizes the rows, meaning that it only renders a small subset of the data, and leaves everything that wouldn't be in view unrendered. This means the grid needs to know how tall every row is, so that it can calculate positioning.
If it had to measure every row when rendered this would cause the browser to repaint over and over and performance would be miserable.
You'll find that other virtualized tools (like Ionic's collection-repeat) have the same limitation.
Update:
To answer your second question: you can set a height property on the GridRow object (not your entity, you can use getRow from the grid API to get the GridRow object) and the grid will use this height when rendering the row.
And your third question: no, expandable is only built to work off entire rows. It might be possible to alter what sort of data is displayed in a sub-grid based on clicks in certain cells, but that would require some changes to the expandable code.

Tablesorter custom selection print

I might be on the wrong track, but is there a way to print the table resulted after filtering with tablesorter custom filters available here http://mottie.github.com/tablesorter/docs/example-widget-filter-formatter-1.html ?
If you just use the basic page print, it should print the table as you see it on the screen with the filters applied.
If you want all rows showing, then use a print style to reveal all hidden rows:
#media print {
table.tablesorter tbody tr {
display: table-row !important;
}
}

Resources