GWT datagrid scrolls to last column on sort - sorting

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

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

JqGrid: have a dropped row stay where it was dropped

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.

KendoUI grid - how to make it not overflow, while inside a tab strip?

Following this example - http://demos.kendoui.com/web/grid/detailtemplate.html, I have a grid and a tab strip inside the grid. One of the tabs has a grid within. This table is rather long, so I had to add a scrollbar. The grid overflows - though the scrollbar works, the data spills on to the next row, making the whole thing look ugly.
Is there any way to make the inner grid (the one within the tabstrip) not overflow?
I have seen this. Your parent has to grow to accommodate the last row. You can try placing the grid in a parent element and add a padding to the grid parent while setting the overflow to auto.

slickgrid resize causes scrollbar gap near bottom

I have the following problem:
I use Slickgrid in combination with jquery layout. Panes can be resized with this plugin. When I resize the Slickgrid pane, so that a horizontal scrollbar appears, which wasn't there at first, I am unable to scroll all the way to the bottom.
I have created a jsfiddle to demonstrate:
http://jsfiddle.net/uNMRT/2/
Steps to reproduce:
make sure the slickgrid pane doesn't have a horizontal scrollbar.
scroll all the way doen. (works nicely, you can view record 119, the last one)
resize the slickgrid pane using the vertical splitter. Make sure to make the slickgrid area smaller to have a horizontal scrollbar appear.
scroll all the way down again. Notice that you are unable to scroll completely down. Record 119 can't be seen now.
I already do a resizeCanvas upon resize:
center__onresize: function(pane, $pane, state, options) {
myGrid.resizeCanvas();
}
That's not enough obviously. Any ideas?
I ran into the same issue and it seems like that slick grid does not set the "viewportHasHScroll" flag correctly. I found the following two workarounds to fix the issue (SlickGrid v2.1)
1) Update updateCanvasWidth function (line 396) and change the following line
viewportHasHScroll = (canvasWidth > viewportW - scrollbarDimensions.width);
to (notice the "greater than or equal to" sign
viewportHasHScroll = (canvasWidth >= viewportW - scrollbarDimensions.width);
2) Update handleScroll function (line 1920) and update the if block
//only scroll if they've moved at least one row
if(vScrollDist && (vScrollDist > options.rowHeight)) {
....
}
I am facing the same issue but for vertical scroll. If the container is resized the vertical scroll bar does not scroll completely. It stops on the second last record. Although there is space for the bar to scroll it cannot be moved completely to the bottom. If I pull it down the grid jumps and the bar moves to the original position again. The last record can never be viewed.
I had the issue also when I add a row. It is because you may have not updated the grid correctly. You have to call grid.updateRowCount();

How can I blend in my SegmentedControl in a UITableView better?

As you can see on the screenshot the segmented control is placed rather ugly this way.
I need it in that place, meaning below the section title and before the second cell for that section. How could I make this better?
I can think of two suggestions that would improve the appearance. The first would be to increase the height of the table cell (just that particular table cell, not all of the cells in your table) so that the whitespace margin at the top and bottom of your segmented control is equal to the margin you currently have on the left and right of the control.
Another solution would be to move the selection of the value for this setting into a separate tableView controller that you drill down to. So that cell would show the current value, but tapping the cell would take the user to a new view where the user could select to change the value.
Here is an example of this from the Instapaper app settings page that I think looks pretty clean.

Resources