JqGrid: have a dropped row stay where it was dropped - jqgrid

I am playing with JQGrid and its drag ad drop.
There are good examples here:
http://trirand.com/blog/jqgrid/jqgrid.html
I want to drag a row and dropped it in the same grid. Here is how I achieved this:
jQuery("#grid1").jqGrid('gridDnD',{connectWith:'#grid1'});
The problem is that in the above setting, a dropped row is always placed in the top of the grid (the first row). I want to a dropped row stay where it was dropped. How can I do this? If a jsfiddle is needed, please let me know.
Thanks!

You should use sortableRows method instead of gridDnD to reorder rows in the grid.

Related

handsontable removes and adds cells to the table, how to prevent this?

Handsontable will all an remove off screen cells form the table while scrolling left and right.
How can I stop this. I want all cells to be there, on or off-screen.
Use renderAllRows: true in your handsontable definition

GWT datagrid scrolls to last column on sort

I created a DataGrid in GWT and made the columns sortable.
The width of the columns in total is wider than the width of the DataGrid. So a horizontal scrollbar appears.
Now the problem is that when I for example sort on the first column, the sorting works ok, but the horizontal scrollbar jumps all the way to the right. This is really an undesired effect.
As soon as the last column is visible this does not happen any more.
Is this a known problem ?
To scroll to the first column of the first row:
dataGrid.getRowElement(0).getCells().getItem(0).scrollIntoView();
If you need to scroll to some specific row:
dataGrid.getRowElement(dataGrid.getVisibleItems().indexOf(object)).getCells().getItem(0).scrollIntoView();
[]'s

Kendo Grid Drag and Drop - Can I drag a complete row

I am trying to achieve the functionality of drag and drop in a grid. I am so far successful in dragging a specific column However the UI requirements are that, I should be able to drag a complete row. Is this possible? If Yes, how?
Thanks,
Abinash
I don't have enough points to comment, but if you are looking to drag and drop rows within a grid, that is possible through the Sortable integration to the Grid:
http://demos.telerik.com/kendo-ui/sortable/integration-grid

mouseOver for NSTableView

I have NSTableView in my application and i have added the hovering effect for the rows by using HoverTableDemo.
I can get the hovering effect only for one row in my table.
It is not apply for the whole table.
How can i get Hovering effect for full table.
Can any body have any idea please revert me.
Take a look: https://stackoverflow.com/a/464828/1758762
You're on the right track with -mouseEntered: and -mouseExited:.
Look into NSView's -addTrackingRect:owner:userData:assumeInside: and -removeTrackingRect: methods.
I can get the hovering effect only for one row in my table.
You can either set up your tableView to create trackingRects for every row that's in there whenever the contents of the tableView change, or alternatively, set up/update one tracking area on the entire tableView whenever -tile or another layout related method is called.

Have an NSTableView row always stay in the same place

Im trying to make a trash can system in my app. I have a NSTableView and a trash can row. I want to have the row "stick" to the bottom of the visible table view so it can always be seen. Is it possible to do this and if not is there a better approach to doing this?
Thanks for any help
Sit another utterly separate UIView, on top the views that contain the table.
Simply fake it up to make it look like a row from the table.
As you say, "Thanks that sounds like it will work as long [tableview deselectRow:[tableview selectedRow] works so it appears that the fake row is really in the view." -- that is precisely what you do.
There's no supported way to do this and it might be near impossible. You might try embedding your "main" table view in a container NSView (that observes the table view's frame changes resizes / performs layout when the size changes). This view would leave room at the bottom for a single-row table view with no headers. You could feed the "main" table view all but the sticky row, and feed only the sticky row to the smaller table.

Resources