Hello,
Quick summary: I can't change the style or class of an Element.
Whole story:
I've been trying for weeks to get a GridPanel with the following
characteristics:
1. locally pageable
2. automatic height so there is no need for a vertical scrollbar
3. horizontal scrollbar when needed (the grid size is smaller than
column sizes)
I managed to accomplish 1 and 2, but 3 is the tricky one.
Here is a snip:
grid = new GridPanel();
grid.setStore(store); // store initialized elsewhere
ColumnModel columnModel = new ColumnModel(columns); // columns
initialized elsewhere
grid.setColumnModel(columnModel);
grid.setFrame(false);
grid.setStripeRows(true);
grid.setWidth(gridWidth); // gridWidth small enough so columns need a
horizontal scroll
grid.setAutoHeight(true);
GridView view = new GridView();
grid.setView(view);
grid.setBorder(false);
grid.setAutoScroll(true);
// don't want a selectable grid:
RowSelectionModel selectionModel = new RowSelectionModel(true);
selectionModel.lock();
grid.setSelectionModel(selectionModel);
// paging toolbar
pagingToolbar = new PagingToolbar(store);
pagingToolbar.setPageSize(pageSize);
pagingToolbar.setDisplayInfo(true);
grid.setBottomToolbar(pagingToolbar);
store.load(0,pageSize);
// ... etc
When debugging with Firebug, I discovered that in order to get the
horizontal scrollbar, I have to either to disable the style attibute
"overflow=visible" of the div whose class is "x-grid3-scroller".
This can be done by adding a class that specifies "overflow=hidden !
important", or by explicitly changing the style of this div.
I had a hard time investigating how to retrieve this div element:
Element el = grid.getEl().child("div[class=x-grid3-scroller]");
(note: I can only do this after the grid has been inserted in a panel,
I suppose that this is only possible after it has been rendered)
So my question is: how can I change the style or class of this
Element?
I tried:
Ext.fly(el).setStyle("border", "5px solid blue");
also:
Ext.get(el).setStyle("border", "5px solid blue");
And tried to add a class with the same fashion:
Ext.fly(el).addClass("test1");
or:
Ext.get(el).addClass("test2");
Of course, there must be something wrong with this since it's not
working. When debugging with eclipse, I can see that the setStyle and
addClass does modify the "el" variable, but the changes are not
visible...
Please, could anyone shed a light with this problem?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---