How to remove dragged row trail in NSTable View? - nstableview

When I am dragging a row from NSTableView. It shows a shadow trail of the specific row which is being dragged. Didn't found any method to remove it. I also tried to subclass NSTableRowView. Tried all the methods, didn't found any solution.

Related

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.

Reordering Qt Listview via drag'n'drop

I have tried the approach described in http://agateau.com/2016/reordering-a-listview-via-dragndrop-3/ to implement drag'n'drop support in a listview.
However, when the amount of items in the list grow there is a problem when scrolling while dragging.
To reproduce the problem, download project from https://github.com/agateau/listviewdragitem/tree/3-placeholders. Triple the amount of items in the list, and try to drag an item (all but first) to the end of the list. The dragged tem will dissapear when the list has scrolled for some time. I have not noticed any signals beeing emitted indicating that the drag has completed.
The first item can be moved correctly for some reason.
Do you have any suggestions what may cause this behavior?
The reason, that the first Item does not disappear is, that it is the currentItem which is protected from deletion.
The reason that the other Items suddenly disappear is, that the ListView instantiates and destroyes the Items as it thinks they are visible. This means: As they would be visible on their original position.
Set the currentIndex to the index of the Item that is being dragged, to prevent it from being destroyed.
Also you could use a DelegateModel and add relevant Items to the persistent group, to prevent destruction.

How can I create a draganddrop wrapper inside a table row, that can represent the whole row

When I use treetable in Vaadin, it is working fine drag and drop the whole row when click the left and right blank ereas. but that is not user friendly, I wanna create a draggable layout inside the row, let's say the 1st component of the each row, that when clicking it, the whole row is selected and can be draged and dropped to reorder.
The thing is I can create a vertical layout with wrapper doing that, but drag mode is only for its component or the wrapper itself, and when doing the drag action, it doesn't actually showing the whole row is moving, which may confuse the clients. What can I do to make it looking like I am dragging the whole row, similar with the one you drag the blank area of each row? Thanks.
I'm afraid there currently is no way for adding a wrapper that would extend the entire row instead of just one cell. To do this you'd need to extend the client-side implementation of Table (VScrollTable) and this is not something I would recommend as it is quite complex.
I do think that what you describe should be possible in core Vaadin (without using drag & drop wrappers), so could you please file a ticket at dev.vaadin.com? And please attach a small application showing the problem to make it easier for us to see the problem and fix it.
Anyways, in order for you to get it working today I'd suggest that you change your UI design a bit and for example borrow drag handles from iOS. By this I mean that you could add an icon that suggests "draggable" as a background-image in the first cell (or in the row header cell of each row) that encourages the user to grab the row there, where it is "empty" and dragging works. This way the user might not be too confused if dragging only works reliably in some parts of the rows.

Add row dynamically to AdvancedDataGrid

I would like to add new row on the fly (runtime) to my AdvancedDataGrid.
I can add it to the data model, but couldn’t find a way to make the table render and show the new row.
What i am seeking for is to create an effect of expandable item, where clicking on row will show "additional information" (like a drawer) and clicking on row expand button will reveal it's children.
I saw examples of this for dataGrid (http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html), but not for AdavancedDataGrid.
Only way I found to do this is to add a new child and use openItem, but this cause the other children to be visible as well.
Any help is greatly appreciated
you need to revalidate the whole datagrid after you added a new item, so that all the new elements can become visible.
yourDataGrid.validateNow();
This should help:)

Flex datagrid control with expanding rows

I'm looking for a DataGrid with expandable rows implementation in Flex. I don't want to use Advanced DataGrid control because it's too slow and too complex.
The desired behavior is like this: when you click a row, a panel opens between the rows with some details and the rest of the rows are moved down, and when you click again the panel is closed and the rows are back to normal. If you click the other row, the one that was expanded collapses and the row you clicked is expanded.
You'll probably need to use a custom ItemEditor that responds to clicks and expands itself.
The variableRowHeight property may need to be set to true as well.
The behavior you are describing sounds an awful lot like an Accordion component, though that doesn't quite sound like what you are looking for. Another approach would be to use a List component with a custom itemRenderer that is expanded when in the selected (clicked) state, and collapsed when not selected.
We extended Flex Datagrid component and used custom item renderer for this. We actually expand one cell and resize it to cover all other cells in the same row. While this may be not the easiest solution it works and the Datagrid is very fast.

Resources