TableView Enhancements - javafx

The TableView still leaves a lot to be desired. Does anyone have a more complex example of a TableView that you would like to share? Here's what I'm missing:
Insert and Delete row:
Possible solutions:
press TAB on the last cell and new row gets inserted automatically
right mouse button -> context menu -> insert line (or delete line)
a table footer with table navigation and insert/delete buttons (like MS Access)
keyboard shortcut
...
Insert and Delete should be either at the current row position or at the bottom of the table. Of course the new row should be highlighted.
Copying / Duplication of rows inside the TableView
Copy selected cells to the clipboard
(solution exists: copy multiple cells to clipboard, paste into table is missing)
Insert a row with default values
Type to Edit: I don't want to have to doubleclick on a cell first in order to edit it. When you type on a cell, the table should automatically go into edit mode.
Navigation options like e. g. TAB = cell in next column, ENTER = cell in next row
Filtering should be possible via components inside the tableview, not via components (TextField etc) outside of it. A filter indicator (like the sort indicator) would be nice.
Changing the visibility of columns should be convenient, not via multiple clicks of the tableview menu button (for every column you have to click the menu button separately to show the available columns). The tableview menu button should be customizable
(solutions exist with reflection and without reflection)
Row and column headers should be possible
Validation of cells, so that when you are in edit mode and enter text instead of digits into a numeric cell you get the option to cancel the edit mode and revert to the default value
A (fixed) table footer which could e. g. show the sum for each column would be nice
Freezing of columns (there's already a Jira task for this)
Some of these were covered partially years ago from what I've seen. But I couldn't get a clear How-To impression and maybe things have changed with JavaFX8.
In case someone likes to contribute to any of these mentioned features, please share your thoughts. Thank you very much.

Related

Ag-grid dynamically span entire row

I have a grid that presents database entities one per row with some crud options (the crud options are icons in their own cells). When the delete button is clicked, the design calls for the entire row to be turned into a confirmation message with buttons to continue or cancel.
Apparently you can give a function for colSpan on each colDef. I tried giving the first colDef a span equal to the number of displayed columns in the case that the row data has a property isDeleting === true, while clicking the delete icon would set the row data's isDeleting property to true.
I was unable to get this to work, and even if I were to get it to work, I'd need to be able to dynamically change the cell so that it contains the confirmation message.
Any help is greatly appreciated.
After a very long day of searching, I found this article on "full-width" rows. You can provide your gridOptions with an isFullWidthCell function, plus fullWidthCellRenderer and fullWidthCellRendererParams properties, and the full width of the row will be populated using the renderer according to the params (as is the case with a cellRenderer in a ColDef)
So, my delete button component can set a piece of data that the isFullWidthCell function can check for, and if it finds it, it will use the cellRenderer provided.
AgGrid seems to have thought of everything.

Highlight NSTableView rows as if right-clicked

I'd like to make an NSTableView highlight its selected rows as if one was right-clicked.
When a selected row is right-clicked (and if the table view implements a menu), the view draws a rectangle at the perimeter of each block of selected rows. This is the default behaviour. See below:
I want the table to do that outside of the context of a right-click. FYI, this is to implement a custom dragging Destination Feedback Style to make clear that some action will be applied on the selected rows.
I can programmatically select rows, but not make them highlight in this way.
Still, Appkit must have some method for that since it does it upon right-click.
I could find a solution involving subclassing NSTableView or NSTableRowView, but there may be a simple solution.
Thanks.

Is it possible to duplicate a row in grafana?

I want to have many rows on the same dashboard which are very similar, so row duplication would prove very handy.
However from what i can see it's only possible to duplicate a panel.
So is it possible to duplicate a row (consisting of multiple panels)?
Or you can use wizzy to duplicate a row on a Grafana dashboard
wizzy copy row 1 2
Here are the links for getting starting with wizzy:
https://github.com/utkarshcmu/wizzy
https://utkarshcmu.github.io/wizzy-site/home/getting-started/#installation
You can. First create a template: On your dashboard click settings, Templating and create your template variable.
Next, in your panel click on the green bar, Row Editor, select Repeat Row and put your template-variable there.
There is a nice gif-example here underneath "Repeating Rows and Panels":
http://docs.grafana.org/guides/whats-new-in-v2-1/
Per How to automatically repeat rows and panels in dynamic dashboards
Edit the panel by clicking the title of the panel, and click Edit.
In the panel editor, open the Repeat options section.
In Repeat by variable, select the instance variable.
In Repeat direction, select Horizontal to lay out the repeated panels horizontally.
Apply your changes to go back to the dashboard.
Click Add panel, and then click Convert to row. The panels you created earlier are automatically assigned to the row you created.
Hover your cursor over the Row title and click the gear icon to open the Row Options.
In Title, enter $service.
In Repeat for, select the variable you want to repeat rows for. For this example, select service.
Click Update.
Select multiple services from the service drop-down menu. Grafana creates a row for each selected service, each within its own set of repeated panels.
Find the left-most panel in the top-most row and edit it.
In the text area for the Text panel, enter $instance and $service.
Save the dashboard and refresh the page.

How to highlight a row in QTableWidget?

I'm having a QTableWidget with 9000 data. I can search data from the table, like, if I search for '10', whole data starting with '10' will be displayed.
Now I need to highlight the first row, since it shows the accurate search result.
I'm using:
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
for highlighting the selected row.
How can I highlight the first row of table?
I am not sure I am clear of why you need to set selection behavior unless you are planning for the user to be able to do the selection by clicking on the cells. And if you want that to be the default behavior then just set this as a property of the tableWidget when you use the QT designer.
But you can certainly do:
ui->tableWidget->selectRow(0);
That will highlight the row.

Using the Tab key to navigate form inputs

I am having some problems with tabbing within my asp.net pages. This project was developed with Visual Studio 2008.
Case 1
I have two html tables. The first table has two rows; the second table has four rows. Within the cells are of each table are asp.net fields, text boxes and radio button lists. I set focus to the first field of table one. I then press the tab key multiple times. The focus moves through the field of table one and then through the fields in the first row of the table two. Then instead of goes to the second row of the table two it return to the table one.
But if I set focus to the last cell on the first row of table two, it tabs through the remaining cells of table two properly. Can you tell me how to get the tabbing to behave properly and go to the cells in there natural order? Note that I am setting the tab index property in the order that I want.
Case 2
On another page I have an html table with a single row followed by a gridview control. The gridview control is writeable and has the following columns: Check Box, Radio Button List, Text Box, Text Box, Text Box and a Check Box List. If I click on one of Check Box, Radio Button List or Check Box List., then press tab, the cursor pops out of the grid and sets focus on the first field of the table outside the grid. But if I set focus on one of the text boxes and tab; then the tab goes through the fields of the grid left to right one row at a time. This later behavior is what I want in both cases. I don’t know why my cursor pops out of the grid when I start with a field other than a text box.
Please help if you can.
Bob
funny, you explain in details your case but you didn't explain what it needs to be explained in order to someone can understand you :)
first of all, is table1 located in the first tab and table2 in second tab?
what do you used for tabs: asp.net tab control, jquery ui tabs...?
what do you mean by 'press the tab key multiple times'? same tab? do you have postback on tab click? what is the focus in your case, and so on and on...
cheers
Have you checked the order of the input elements in your HTML? Generally the tab order follows the order of controls.
If that all looks right, then make sure nothing is setting the TabIndex property - as this will also mess up the tab order.
I pretty much resolve this and I wanted to add the answer for anyone who viewed this thread. The problem was the autpostback on certain fields. Once I disabled autopostback, the problems went away.
Bob
You need to use Javascript and I referred for your a very good example of navigating through Gridview rows with Up/Down keys.
http://www.codeproject.com/Articles/25675/GridView-Rows-Navigation-Using-Arrow-Up-Down-Keys

Resources