Grid does not resize properly when going smaller: Setting overflow hidden on the container element will correct this
If you get el.style[camel]= NaNpx or -2px or something related, be certain you have given your container element dimensions.
The grid adapts to your container's size, if your container has no size defined then the results are unpredictable.
Do not render the grid into an element with display:none. Try using visibility:hidden. Otherwise there is no way for
the grid to calculate dimensions/offsets.
CSS can be used to style or customize the behaviour of headers an cells.
For example, use this to wrap all cell contents globally
.x-grid3-cell-inner {
overflow: visible; white-space: normal !important;
}
To wrap cell contents on a certain table only, set an ID to the Grid panel (say company-grid) and then use the CSS
#company-grid .x-grid3-cell-inner {
overflow: visible; white-space: normal !important;
}
setMaxRowsToMeasure(int maxRowsToMeasure) If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of rows measured to get a columns size.
public void
setMinColumnWidth(int minColumnWidth) The minimum width a column can be resized to.
public void
setMonitorWindowResize(boolean monitorWindowResize) True to autoSize the grid when the window resizes.
Creates a new Grid.
Parameters: id - the Grid ID Parameters: width - the Grid width Parameters: height - the Grid height Parameters: store - the Grid's data store Parameters: columnModel - the Grid's column model
Reconfigures the grid to use a different Store and Column Model. The View will be bound to the new objects and refreshed.
Parameters: store - the new Store Parameters: columnModel - the new ColumnModel
render
native public void render(JavaScriptObject grid)(Code)
The id of a column in this grid that should expand to fill unused space.
This id can not be 0. Default is false. Note : You must pass the ID of the ColumnConfig, and not the dataIndex of the corresponding ColumnConfig. Parameters: autoExpandColumn - the column id throws: IllegalStateException - this property cannot be changed after the Component has been rendered See Also:com.gwtext.client.widgets.grid.ColumnConfig.setId(String)
The id of a column in this grid that should expand to fill unused space. This id can not be 0.
Default is false.
Parameters: autoExpandColumn - the column id throws: IllegalStateException - this property cannot be changed after the Component has been rendered
The maximum width the autoExpandColumn can have (if enabled). Default is 1000.
Parameters: autoExpandMax - the max expand value throws: IllegalStateException - this property cannot be changed after the Component has been rendered
The minimum width the autoExpandColumn can have (if enabled). Default is 50.
Parameters: autoExpandMin - the min expand value throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to fit the height of the grid container to the height of the data. Default is false.
Parameters: autoHeight - true to fit the height of the grid container to the height of the data throws: IllegalStateException - this property cannot be changed after the Component has been rendered
The
ColumnModel to use when rendering the grid (required).
Parameters: columnModel - the grids column model throws: IllegalStateException - this property cannot be changed after the Component has been rendered
The DD group this GridPanel belongs to (defaults to 'GridDD').
Parameters: ddGroup - the DD group throws: IllegalStateException - this property cannot be changed after the Component has been rendered
setDragDropText
native public void setDragDropText(String text)(Code)
Sets the Grid's drag drop text
Parameters: text - the drag drop text
True to enable hiding of columns with the header context menu. Default is true
Parameters: enableColumnHide - true to enable column hide throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to enable drag and drop reorder of columns. Default is true.
Parameters: enableColumnMove - true to enable column move throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to enable column resize.
Parameters: enableColumnResize - true to enable column resize throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to enable Grid context menus.
Parameters: enableCtxMenu - true to enable context menu throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to enable drag and drop of rows. Default is false.
Parameters: enableDragDrop - true to enable drag drop of rows throws: IllegalStateException - this property cannot be changed after the Component has been rendered
setHideColumnHeader
public void setHideColumnHeader(boolean hideColumnHeader)(Code)
Hides the column header of the grid if passed true.
Parameters: hideColumnHeader - true to hide the column headers
setLoadMask
native public void setLoadMask(String message)(Code)
Sets the load mask message for the grid.
Parameters: message - the load mask text
True to mask the grid while loading. Default is false.
Parameters: loadMask - true to mask grid throws: IllegalStateException - this property cannot be changed after the Component has been rendered
Sets the
com.gwtext.client.widgets.LoadMask to mask the grid while loading. Default is disable masking.
Parameters: message - the load mask message Parameters: messageCls - the load mask message CSS class throws: IllegalStateException - this property cannot be changed after the Component has been rendered
If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of rows measured to get a columns size.
Default is 0 (all rows).
Parameters: maxRowsToMeasure - max rows to measure throws: IllegalStateException - this property cannot be changed after the Component has been rendered
The minimum width a column can be resized to. Default is 25.
Parameters: minColumnWidth - the min column width throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to autoSize the grid when the window resizes. Default is true.
Parameters: monitorWindowResize - true to monitor window resize throws: IllegalStateException - this property cannot be changed after the Component has been rendered
Set the GridPanel's selection model.
Parameters: selectionModel - the selection model/ throws: IllegalStateException - this property cannot be changed after the Component has been rendered
The Store the grid should use as its data source (required).
Parameters: store - the store throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to stripe the rows. Default is true.
Parameters: stripeRows - true to stripe rows throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to highlight rows when the mouse is over. Default is true.
Parameters: trackMouseOver - true to highlight rows when mouse over throws: IllegalStateException - this property cannot be changed after the Component has been rendered
Sets the
GridView used by the grid.
Parameters: view - the grid view throws: IllegalStateException - this property cannot be changed after the Component has been rendered
True to stripe the rows. Default is false.
Parameters: stripeRows - true to stripe the rows. Default is false. throws: IllegalStateException - this property cannot be changed after the Component has been rendered
Methods inherited from com.gwtext.client.widgets.Panel