-
4 May 2010 12:09 AM #1
[CLOSED] LiveGridView and RowExpander bug
[CLOSED] LiveGridView and RowExpander bug
- GXT version: 2.2 (revision 2057).
- Host mode / web mode / both: both.
- Browser and version: All.
- Operating System: All.
- Detailed description of the problem:
RowExpander works incorrect with liveGrid view:
If u expand the last row it isn't affect on scroller at all;
I think i mast work like in http://www.extjs.com/examples/#gridplugins, Expander example.
Sample code:
Test case:Code:public class Empty implements EntryPoint { GreetingServiceAsync greet = (GreetingServiceAsync) GWT .create(GreetingService.class); boolean isFiltred = false; public void onModuleLoad() { RpcProxy<PagingLoadResult<ModelData>> proxy = new RpcProxy<PagingLoadResult<ModelData>>() { @Override public void load(Object loadConfig, AsyncCallback<PagingLoadResult<ModelData>> callback) { int iOffset = ((PagingLoadConfig) loadConfig).getOffset(); System.out.println("iOffset=" + iOffset); if (!isFiltred) { ArrayList<ModelData> result = new ArrayList<ModelData>(); for (int i = 1; i <= 9; i++) { BaseModel bm = new BaseModel(); bm.set("num", iOffset + i); bm.set("text", "test"); BaseModel bm1 = new BaseModel(); bm1.set("text", "test"); bm.set("bm1", bm1); result.add(bm); } callback.onSuccess(new BasePagingLoadResult<ModelData>( result, iOffset, 9)); } else { ArrayList<ModelData> result = new ArrayList<ModelData>(); for (int i = 1; i <= 1; i++) { BaseModel bm = new BaseModel(); bm.set("num", i); bm.set("text", "test"); BaseModel bm1 = new BaseModel(); bm1.set("text", "test"); bm.set("bm1", bm1); result.add(bm); } callback.onSuccess(new BasePagingLoadResult<ModelData>( result, iOffset, 1)); } } }; // loader final PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>( proxy, new ModelReader()); loader.setRemoteSort(true); Store<?> store = new ListStore<ModelData>(loader); ArrayList<ColumnConfig> columns = new ArrayList<ColumnConfig>(); RowExpander rx = new RowExpander(); rx.setTemplate(XTemplate.create("<p><b>clo1: </b>{text}</p>" + "<p><b>clo2: </b>{text}</p>" + "<p><b>clo3: </b>{text}</p>" + "<p><b>clo4: </b>{text}</p>" + "<p><b>clo5: </b>{text}</p>")); columns.add(rx); columns.add(new ColumnConfig("num", "num", 100)); columns.add(new ColumnConfig("text", "text", 100)); columns.add(new ColumnConfig("text", "text1", 100)); columns.add(new ColumnConfig("text", "text2", 100)); columns.add(new ColumnConfig("text", "text3", 100)); columns.add(new ColumnConfig("text", "text4", 100)); columns.add(new ColumnConfig("text", "text5", 100)); columns.add(new ColumnConfig("text", "text6", 100)); columns.add(new ColumnConfig("text", "text7", 100)); ColumnModel cm = new ColumnModel(columns); final Grid<ModelData> grid = new Grid<ModelData>( (ListStore<ModelData>) store, cm); grid.setLoadMask(true); grid.setBorders(true); grid.addPlugin(rx); // grid.setAutoExpandColumn("text"); LiveGridView view = new LiveGridView() { @Override protected void afterRender() { mainBody.setInnerHtml(renderRows(0, -1)); renderWidgets(0, -1); processRows(0, true); applyEmptyText(); // refresh(); } }; view.setCacheSize(100); view.setPrefetchFactor(0); grid.setView(view); ContentPanel panel = new ContentPanel(); panel.setFrame(true); panel.setCollapsible(true); panel.setAnimCollapse(false); panel.setHeading("Test"); panel.setLayout(new FitLayout()); panel.add(grid); panel.setSize(600, 350); Button load = new Button("Load"); load.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { isFiltred = false; loader.load(); } }); Button loadFitred = new Button("Load Filterd"); loadFitred.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { isFiltred = true; loader.load(); } }); ToolBar tb = new ToolBar(); tb.add(load); tb.add(loadFitred); panel.setTopComponent(tb); LiveToolItem liveTool = new LiveToolItem(); liveTool.bindGrid(grid); ToolBar tb2 = new ToolBar(); tb2.add(new FillToolItem()); tb2.add(liveTool); panel.setBottomComponent(tb2); RootPanel.get().add(panel); }
-0- Open code above.
-1- Press Load button.
-2- Now Expand the last row.
-3- Now one row before.
-
4 May 2010 12:13 AM #2
LiveGridView cannot work with rowexpander by design. You should use the help forum for future post and not always the bugforum
-
4 May 2010 12:56 AM #3
-
4 May 2010 1:09 AM #4
You need a rowheight that is not going to change for livegridview. So when you change the rowheight (expanding one) it cannot work anymore.
Feel free to extend LiveGridView to support this feature. I actually did it already for an app i build.
-
4 May 2010 1:11 AM #5
I dont think this will change anything. The first forum that should be accessed should always be the help forum. I am monitoring all forums and move bugs to this one.And maybe u should more often use assert command, then I will post questions into questions, and bugs into bugs. Cos now it's look like a bug.
Most people dont even look if exceptions got thrown. So an assertion would be very bad for them.
Best example here: http://www.extjs.com/forum/showthrea...ach-a-Listener.
We are looking into a complete redesign for GXT3
-
4 May 2010 1:34 AM #6
I understand this. But I think assertion is requered. Even me use a lot of alerts, and i just optimizing ur framework for oracle database. And U are writing a framework, user may ignore errors, but it only they problems
, not yours.
Look I spend a lot of time to add columns into row expander, after i spend alot of time to make it format data, like show date as date and number as number. And all this time all works fine with LiveGrid
and only when I expand, it on a last row
it doen't affect on scroller, so i thinking: "oh it's a bug"
ok. I already add selection saving functionality, add scrolling with keyboard in Live grid View, I'll add it too by myself.
Can I ask a little question? How can I, increase scroller height on a fly? grid.getView().getBody().setHeight look like a pre-rendered property
-
4 May 2010 1:38 AM #7
The scroller is not the body element. You can use the liveScroller member for this. Its protected and so can be accessed in the subclass.
It also does not work fine in other rows as all calculations are going wrong when you expand a row. Also if it looks correct, it isnt.And all this time all works fine with LiveGrid and only when I expand, it on a last row it doen't affect on scroller, so i thinking: "oh it's a bug"
You need to change the hole way livegridview works. I would suggest you take a different design approach than rowexpander.
-
4 May 2010 2:17 AM #8
hm, nope i haven't another choice, a lot of columns in grids
better to use Pagging, but it takes some a lot of space on form.
I'll try to add expander support. just for try if I will not be succeeded I'll just use a paggingView.
I found a liveScroller El, but how can I change it Height??
-
4 May 2010 2:18 AM #9
I found a liveScroller El, but how can I change it Height??Code:liveScroller.setHeight(mynewheight);
-
4 May 2010 2:24 AM #10
It's make it bigger, Scrolling by itself. and not affected scroll position.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote