How to move on drag&drop between ListGrids in SmartGwt - smartgwt

I'm writing SmartGWT application, and I have two list grids and some records inside.
I have setDragDataAction to MOVE. But there occurres problem, when I drag&drop records, they always copy instead of move, but if I use transferSelectedData method it's OK. When I drag&drop into same ListGrid there is the same problem, records are copied, not moved.
Is there way to set drag&drop action to move, not copy?

The method setDragDataAction(DragDataAction.MOVE) shall do the trick for you.

I had the same problem and after some tests, here is the conclusion : whenever there is a databound list of records, the setDragDataAction(DragDataAction.MOVE) is not working. If it's not databound, it works. Any suggestions for a workaround?

Related

Swapping table td on drag

I am trying to swap two TD elements in table on Drag&Drop. I found this plugin Swappable and it works in some way. But when I drag some element the cursor change position to some specific value. I do not want changing cursor position. But when I rework this plugin it stops work.
Does anyone have experience with it or know about any other plugin?
Thanks,
Zbynek
Usually I use the jQuery sortable. It does pretty much want you want. You can use it in a table too.
Then I do my stuff (including ajax updates) in a function setted in the receive event
Did you try the JQuery Sortable() option?
See http://jqueryui.com/sortable/#display-grid

How to load initial XAML code?

I have a User control with 2 rectangles and buttons (Add, Delete, Clear). Upon clicking Add buttons I add more rectangles, Delete - I delete selected rectangles, and upon clicking Clear I want to return to the initial control with only 2 rectangles, so I just want to pretty much load my XAML code again, but I have no idea how to do it.
Thank you!
You could reload the XAML, but it would be over-complicated and not ideal.
The best way is to keep track of the objects you add (for ex putting them in a list) and removing/destroying them when you are clicking on Clear.

Delphi - ListView Question

Is there a ListView (ListBox) or similar component that allows me to easily drop another component in a specific column. (Multiple columns)? Like a checkbox, button or drop down list or all the above. (It would be nice to be able to sort via the header also)
If not does anyone know of a resource on how to custom draw something like this?
Thanks
-Brad
Check out VirtualTreeView at www.soft-gems.net
It does virtually everything :-)

Cause 'hint' to refire on listview as I move over items

Sure I've seen this done before but off-hand I can't find any examples.
I've got a TListView, set in 'report' viewstyle. It has about half a dozen subitems, and one thing we'd like to do is have the 'hint' (tooltip) on the listview dynamically show another field of data. That is, each time you move the mouse over any given row, the 'hint' would show some text relevant to that particular row.
I'm partway there - I can do this using the OnInfoTip method, but unfortunately once a tip has appeared, Windows seems to decide that I don't need to see a hint for the listview again until I move the mouse away from the listview and then back 'over' it again. Simply moving the mouse down to the next row, all-the-time keeping the mouse over the control, doesn't persuade the program to display the new hint.
Just to be clear - I've got OnInfoTip working so that the program does display the right hint relevant to the item I first moved the mouse over. Changing the hint text isn't the issue. The problem is that moving the mouse to another item in the listview doesn't cause the software to show a new hint. (Hope that makes sense).
Is there some proper way of getting this behaviour to work, or am I going to end up doing something icky with mouseovers and then manually drawing a hintbox (etc)?
check the following link:
Display Custom Hints for TListView Sub Items
Edit:
I just checked it now on delphi7 it's showing the hint for every row dynamically after moving the mouse on the listview.
Offtopic: This is simple in Virtual Treeview component, it is build-in feature.
i was using the OnInfoTip event (i didn't need hints for the subitems). the hint was "flashing" (show/hide/show/hide/show/hide/show/hide). found the listview's ShowHint was false. set it to True and it worked as it should.

How to select and move multiple controls at runtime

I have created some custom controls (TCustomControl) in Delphi that I can move them at runtime but only one by one. How I can select two or more of these controls, at runtime again, and move them around all together with the mouse?
Thank you.
Another comercial solution would be from DevExpress: LayoutControl. It allows for drag and drop, grouping, full rearrange, hiding and adding of components at runtime.
If you can't find any simpler way, you can always do it manually. Keep a list of all the selected controls. When the drag operation begins, make another list, this one containing TPoint values indicating how far on both axes each control's Top and Left properties are from the mouse's position. Then, as the user drags the control, continually update the selected controls to keep them at the proper relative positions to the mouse pointer.
I once used a component named handles, that if I remember correctly wasn't too difficult to update to the later versions of Delphi and supported multi-select.
How about a commercial solution? The screen shot shows alignment tools, which would suggest that it supports multi-select.

Categories

Resources