Advanced Methods

Advanced methods offer the ability to dynamically change properties of the colModel. To keep the basic code small, these reside in a separate module (grid.custom.js) that must be installed for these to be available. See Installation

Method Parameters Returns Description
getColProp colname an array of the properties of the given column from colModel
GridDestroy grid_id true on success, otherwise false Destroys the entry grid from the DOM (clears all the html associated with the grid and unbinds all events)
GridUnload grid_id true on success, otherwise false The only difference to previous method is that the grid is destroyed, but the table element and pager (if any) are left ready to be used again.
setColProp colname, properties jGrid object Sets new properties in colModel. This method is ideal for dynamically changing properties of the column. Note that some properties - like width and align - have no effect. For example:
jQuery("#grid_id").setColProp('colname',{editoptions:{value:"True:False"}})
will change the editoptions values.
sortGrid colname,reload jGrid object Sorts the given colname and shows the appropriate sort image. The same (without sorting image) can be done using
setGridParam({sortname:'myname'}).trigger('reloadGrid')
If the reload is set to true, the grid reloads with the current page and sortorder settings.



  Last Updated: 2/15/2009 | © Tony's jqGrid - a jQuery Plugin, 2010