I am using smartGwt 4.0, ListGrid allows us to add multiple columns with auto generated checkbox selection. I am using below property to get checkboxs for each record in the grid,
listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
I have many columns in the ListGrid so it comes with horizontal scrollbar, when i try to scroll to the right side, the selection checkbox column gets scrolled and after verifying mutil column values user has to scroll all the way left to select the record, this is bit annoying, is there a way to freez the checkbox column in ListGrid...?
yes you can do it using ListGridField#setFrozen().
whether this field should be "frozen" for the purposes of horizontal scrolling.
sample code:
listGridField.setFrozen(true);
--EDIT--
Try with ListGrid#freezeField() or other equivalent methods.
For detailed information have a look at FrozenFields
If it doesn't work then add your checkbox column instead of using default checkbox selection appearance and now make it frozen.
Related
I have a Vaadin 14 Flow application that presents a grid of tasks that can be added to and deleted from as well as editing a selected task. Currently I have it set up so that if the user clicks a row (single select), it opens an editor so they can edit the task.
What I'd like to do is have a checkbox on each row that can be used as a multi-row selector to allow deleting multiple rows.
Would it be easier to just have the table be multiple selection enabled and just delete whatever row(s) are selected? I assume multi-selection allows the usual shift-click to select a contiguous range and control-click to select rows at random.
If I switch to multi-select, how will this affect the ability to simply click a row and have it open an editor for that row? If multiple rows are selected, what is likely to happen?
Update:
I'd never used multi-select until now. I didn't realize it provides checkboxes out of the box (no pun intended).
I had never used multi-select before and didn't realize that using that technique automatically adds a checkbox at the front of the row. Problem solved.
I have an Eclipse SWT table. It contains multiple rows (with row headers) and multiple columns (with column headers). On click on a column header I want to deselect all rows and highlight only the column's header (or all cells of this column). Is that possible?
I already registered a listener for the column header's selection and am able to set the selection to the given column, but then it also always selects the first row automatically. I tried with SWT.FULL_SELECTION and SWT.SINGLE as the style of my table, but it only changes the way how the row is highlighted, but I want only to highlight the column's header (or optionally all cells of this column) and no rows.
Is it possible? Did anyone have the same problem?
I ran into the same problem and I'm afraid you can't do that in SWT.
I solved by imitating the selection of a column; I colored the cells as if they were selected, and dropped the "real" selection.
You should extend your own TableViewer and override the getSelection() method to reflect that you now also have this imitated kind of selection.
(And from a UX perspective, you should make sure that a copy command (i.e. Ctrl+C) behaves as users expect it.)
I have a JavaFX TableView with some columns and some rows. Each column has a custom TableCell to be edited, for example: some columns use text fields, some others use check boxes, choice boxes and so on.
What I want is to edit several cells (simultaneously) in the same column by doing the following:
Select some rows in the TableView.
Click on a cell using the right mouse button.
A context menu is shown with the option "Edit All"; choose it.
Somehow I edit one of those cells and every cell in the same column whose row is selected commits the same value.
What I want to know is whether it is possible for every cell to “commitEdit” the same value. I cannot find the way of doing it.
Thanks in advance.
Is there a way to make, let say first 3 out of 7, columns fixed in Cell table. I want to be able to see always first three columns and have horizontal scroll on others.
You will have to create a custom widget that consists of a ScrollPanel, which includes two CellTable widgets set side by side. The right table should be wrapped in a FlowPanel with overflow-x property set to AUTO (overflow-y should remain at HIDDEN).
You can use the same DataProvider for both tables to synchronize all changes. Be careful with the SelectionModel though, if you need it. I would limit selection to the first column of checkboxes and disable selection by clicking on a row.
Make sure that your widget fits into its space, or you may end up with two horizontal scrollbars - one for the ScrollPanel and one for the right table. Finally, remember to set sizes on both tables so that they have the same height.
I've got a CellTable wich work with SingleSelectionModel to make single selection and show some information into details panel. Also I've got CheckBoxCell column into this CellTable which work with another MultipleSelectionModel to make mass delete operation.
When I try to click on check box in CheckBoxCell column GWT selects row and after second click on checkbox it change checkbox state. So we should make two clicks, but I need to do it (change checkbox state) by one click.
I tried different ways to fix it:
Change dependsOnSelection and handlesSelection parameters into CheckboxCell
Change SelectionEventManager in CellTable (DefaultSelectionEventManager.createCheckboxManager(), DefaultSelectionEventManager.createCustomManager)
But it doesn't work.
I found similar problems into Internet but all of them work with one MultipleSelectionModel. It's not the same what I want, because there's details panel (So I could make only single selection).
Can anyone help me to figure out how to resolve it?
UPD:
I've just removed SingleSelectionModel and redesigned UI to working with MultipleSelectionModel. It's GWT-hell..
Try to switch your selection models: use the MultiSelectionModel as the CellTable's selection model, so that the checkboxes work as expected (with both dependsOnSelection and handlesSelection set to true), and for the master-detail feature, use a CellPreviewEvent.Handler (or DefaultSelectionEventManager#createCustomManager), and RowStyles and getRowElement+addStyleName/removeStyleName for rendering (RowStyles when the CellTable renders the rows, then getRowElement to dynamically update styling).