Released 2008-10-14
IMPORTANT: Modules have been restructured
In response to many requests, the structure of the modules has been revised.
- all text strings now reside in a separate module. This will allow dynamically changing the language. The modules are named grid.locale-(two letters for the locale).js. For example, for English this should be grid.locale-en.js. Modules available are English (en), Bulgarian (bg) and Italian (it).
- Also, to overcome writing a lot of repeatable code for inline, form and cell editing modules, some common functions have been gathered in another module called grid.common.js.
Both of these new modules are required for the proper functioning of jqGrid.
Bug Fixes
- fixed editRow method where addRowData method is used; there was a bad 3rd parameter: 'top' instead of 'first'.
- fixed jsonReader when trying to set the id of the row from non-existing data
- fixed jsonReader bug when trying to set id:0
- fixed beforeInitData event in formedit module when we create the modal for first time
- fixed validation in formedit module when the first column has a validation rule
- fixed bug in inline edit module when running in IE6/IE7 and setting input text with attr size = 0
- fixed bug in image path when creating modals.
- fixed resizing bug when jqGrid is used with jQuery UI
- fixed bug in FF when trying to show caption
- doubleclick has been removed from tree grid as it was causing problems in selection
- fixed bug when clicking on a checkbox of a particular row and multiselect is true and multikey is set
- fixed bug in aftersavefunc - the response parameter passed to this event is now response.responseText (introduced in early releases of Version 3.3).
- fixed bug in the loader - support for Safari.
User Contributions
- Show/Hide Columns, a modal dialog allowing users to choose which columns to show or hide. Contributed by Piotr Roznicki.
- Table to jqGrid, Convert an existing html table to jqGrid. Contributed by Peter Romianowski.
Additions and Enhancements
Installation
The structure of the package is extended with two additional folders containing packed versions of jqGrid. See
Installation.
basegrid
- added property forceFit (boolean, default false) When set to true and resizing the width of a column, the adjacent column (to the right) resizes so that the overall grid width is maintained (e.g., reducing the width of column 2 by 30px increases the size of column 3 by 30px). In this case there is no horizontal scrolbar. Note: this option is not compatible with shrinkToFit option - i.e if shrinkToFit is set to false, forceFit is ignored.
- added property sortclass (string, default 'grid_sort') the class to be applied to the header element (<th>) of the currently sorted column
- added property resizeclass (string, default 'grid_resize') the class to be applied to the columns that are resizable so that we can show a resize handle for ones that are resizable
- added property gridstate (string) Determines the current state of the grid (i.e. when used with hiddengrid, hidegrid and caption options): can be either 'visible' or 'hidden' .
- added event onHeaderClick(gridstate) can be used when clicking to hide or show the grid; gridstate is defined in the previous point.
- added event onCellSelect(rowid, iCol, cellcontent) fires when we click on particular cell in the grid; rowid is the id of the row, iCol is the index of the cell cell, content is the content of the cell. (Note that this available only when we are not using the cell editing module -- and is disabled when using cell editing). Important note regarding IE6: this event may exhibit strange behaviours because of a bug in early IE6 releases. When we have a hidden column the index will not be calculated correctly. You can avoid using this feature in a grid with hidden columns, test for these browsers and conditionally suppress this feature, or suggest that your IE6 users upgrade. For more information refer to http://support.microsoft.com/kb/814506
- added method setGridWidth(new_width, shrink) sets a new width to the grid dynamically. new_width is the new width in pixels. shrink (default true) has the same behavior as shrinkToFit
- added method setGridHeight (new_height) sets the new height of the grid dynamically. Note that the height is set only to the grid cells and not to the grid. new_height can be in pixels, percentage, or 'auto'
- added method getCell (rowid, iCol) gets the content of the cell with id = rowid and index column iCol. Note that iCol is a index and not a name.
- added a third parameter to the afterInsertRow event: rowelem, the element from the response.
- added a third parameter to the onSortCol event: sortorder, the sorting order (either 'asc' or 'desc').
- added method addJSONData: add json data from a custom response into the grid.
- added method addXmlData: add xml data from a custom response into the grid.
- added new DataType, function to take advantage of new methods (addJSONData and addXmlData)
We can now sort a column based on another column. For example, if we have a formatted datetime column for display purposes plus a hidden int value of that datetime, sorts on the displayed column can be based on the hidden one. This can be achieved when using onSortCol event this way:
onSortCol: function(name,index) {
if(name == 'displaydate') {
jQuery("#grid_id").setGridParam({sortname:"hiddendate"});
}
}
colModel
The following apply to all editing modules: inlineedit, formedit, celledit
- added new email validation to editrules: e.g., editrules:{email:true}
- added new edit type: password. e.g., edittype:"password"
- added suport for multiple selection of options in select boxes, e.g., editoptions:{multiple:true, size:4... }
formEditing
- added option checkInput (Boolean) in searchGrid method. When set to true in search Dialog there is a validation of values according the rules in colModel (editrules option)
- added event onInitializeSearch in searchGrid method. This event fires only once when the form is constructed
- added events beforeShowSearch and afterShowSearch in searchGrid method. These events fire before and after showing the search dialog.
- added option title in navButtonAdd - a tooltip option for the button.
- added support for multiple select boxes (see addition to colModel).
Cell editing
This is a new feature of jqGrid, supporting navigation through a grid cell-by-cell with editing (for cells marked as editable). See Cell Editing for details.
Important Note: currently cell editing does not work in Safari browser.
treegrid
custom