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();
Related
I am using NM_CUSTOMDRAW to draw tree view items. My items right justify parts of it by using a right margin based on the RECT area reported available. The issue I have is that when the vertical scrollbar appears or disappears, only the item expanded/collapsed and the area under the scrollbar seems to update (invalidated regions). This causes the repaint requests (with the new width) to not update the area correctly.
For example (using text and a single space as example): You could have something with the scrollbar be right justified text ## where ## is the scrollbar then when the scrollbar goes away you end up with right justified text t instead of right justified text
Is there a good way to fix this?
One thought is if I could catch a message when a scrollbar shows up or goes away, I could just invalidate the window to force a redraw. Is there such a message?
Or is there a way to add to the invalidated region without triggering a redraw loop but would update the full items area?
Another thought is I can just use the full window RECT size and use a right margin large enough that wouldn't be under the scroll area but I'd rather not do that.
Thanks!
I use wxWidgets 3.1.5 under Windows, in which I have developed a I have a wxGrid that contains more columns than can be displayed, so a horizontal scroll bar is needed.
The problem arises when I use FreezeTo in a virtual table base through wxGridTableBase:
if the wxGrid contains more rows than can be displayed both the horizontal and vertical scroll bars are visible,
otherwise, if all rows are displayed, the vertical scroll bar is not displayed, the horizontal scroll bar it is disabled even though it must be enabled.
To prove it you can use the example provided by wxWidgets Grid control wxWidgets sample, modifying the BigGridFrame constructor in griddemo.cpp like so:
// ============================================================================
// BigGridFrame and BigGridTable: Sample of a non-standard table
// ============================================================================
BigGridFrame::BigGridFrame(long sizeGrid)
: wxFrame(NULL, wxID_ANY, "Plugin Virtual Table")
{
m_grid = new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
m_table = new BigGridTable(sizeGrid);
// VZ: I don't understand why this slows down the display that much,
// must profile it...
//m_table->SetAttrProvider(new MyGridCellAttrProvider);
m_grid->AssignTable(m_table);
SetClientSize(FromDIP(wxSize(500, 450)));
//if sizeGrid <12 the horizontal scrollbar will not be displayed, if sizeGrid> = 12 the horizontal scrollbar will be displayed
m_grid->FreezeTo(0, 3);
}
If sizeGrid <12 the horizontal scrollbar will not be displayed, if sizeGrid> = 12 the horizontal scrollbar will be displayed
how can i fix this bug?
(See bug reported on github)
Is it possible to solve it with some workaround on my code, instead of intervening on the wxWidgets library ?
For example shrink the height of the wxGrid so that the bottom edge coincides with the last row ? How can I do it ?
The problem is solved by applying the patch published to:
patch
I see some strange behaviour in jqGrid in IE10 Standard mode, specially when grid size is bigger.
When I scroll using horizontal scroll bar to the right of the grid and then scroll up to see the column headers, they are not visible (blank).
Attaching screenshots. It happens with the jqgrid demo as well
Steps to reproduce :
1. Open the jqgrid in IE10 . http://trirand.com/blog/jqgrid/jqgrid.html -> Frozen Cols Group Header (New) -> Frozen Column
2. Drag some of the columns to the right (increase the width of the columns using mouse).
Resize the window so that all column headers are not visible in the screen.
Use horizontal scroll bar to scroll to the right of the grid.
Use vertical scroll bar to move up to see the column headers.
You will see that some column headers are not visible.
Screenshot can be found # http://postimg.org/image/u1wa4k3er/
Please let me know if anyone has come across this problem and have any suggestions ?
We have a serious problem with SlickGrid in an application.
The problem doesn't seem to have anything to do with the way we implement/built the Grid since the behavior is reproducable on every SlickGrid I've seen.
Here's the problem:
If the User is viewing a grid on less than FullScreen mode and scolls the grid horizontally, then snaps the browser to fullScreen, the column headers are out of sync with the column contents. This wouldn't be a problem if the Horz scrollbar was retained (scrolling even 1px resynch's columns/contents) but if the grid fits inside the window, there is no Horz scrollbar and no way to resynch the columns with the content.
What we need is a method to repaint the column Headers without repainting the entire grid or a patch from someone who has already solved this.
These have no effect:
Options:
syncColumnCellResize:true
Method:
grid.resizeCanvas();
Thanks...
Try the fix submitted in https://github.com/mleibman/SlickGrid/commit/c5324a130ae2ef496f2c007f736f805cc7caa3f0 (get the latest code at https://github.com/mleibman/SlickGrid/zipball/v2.0).
When enableCellNavigation is enabled, the initial click and double-click on my grid immediately scrolls the page down so that the clicked row is at the top of the screen. This is quite annoying since it is not expected. Is there some way to turn this off? If enableCellNavigation is disabled, rows cannot be selected so this is not an option.
You are looking for focusOnCurrentCell()
In my case grid was scrolling to the end horizontally when clicked.
Commenting the focusOnCurrentCell() inside the function setSelectedCell(newCell,editMode) solved my problem.