SMALL improvements in the usage of jqGrid - free-jqgrid/jqGrid GitHub Wiki
There are many standard problems and typical errors of newcomers in the usage of jqGrid. One of the goal of free jqGrid 4.8 was to simplify the usage of jqGrid and to reduce restrictions and to probability of the errors. It will be tried to find a compromises between the possibly good compatibility with the previous versions of jqGrid and still simplifying of the usage.
One don't need to include grid.locale-en.js if one need to use en-US locale. All required settings are included already in jquery.jqGrid.min.js (jquery.jqGrid.src.js).
jqGrid required to have unique id attribute assigned to the base <table> element of the grid. If the <table> have no such id then jqGrid assign it automatically.
It's allowed to use pager: true option. It create automatically the empty <div> an generate unique id to it. After creating of jqGrid the value of pager option will be modified from true to the id selector of the pager div. So one can use getGridParam to get the value if it's required. The behavior of pager: true option is very close to behavior of toppager: true option which is long supported in jqGrid to create top pager. It is possible to us both pager: true and toppager: true to create two pagers: one on the top of the grid and another one on the bottom of the grid.
-
height: "auto"are used now instead ofheight: 150used before. It improves the visibility of small grids or the grids having small number of rows. NoscrollOffset: 0are required to remove unneeded free space which one sees on some grids which have no vertical scrollbar. If one want to hold the old 150 value one need to includeheight: 150option explicitly. -
gridview: trueare used as default with the only exception:afterInsertRowcallback are defined. The usage ofgridview: trueimproves performance of rendering of the grid. In case of usageafterInsertRowin old projects instead of much more effectivecellattr,rowattror custom formatters one will have backward compatibility. -
editurl: "clientArray"are use now instead ofediturl: nullused before. It allows to use local editing without minimal additional efforts and the requirement to have any server part implemented. -
cellsubmit: "clientArray"are use now instead ofcellsubmit: "remote"used before ifcellurlis undefined.
-
dynamic default value is used now for the
datatypeoption. If one uses input optiondataor if one don't specified anyurloption, then undefineddatatypewill be initialized to"local". If one uses nodataoption and specifiesurloption then one initializesdatatypeto"json"if the input optionjsonReaderare used. In case of usage any other combinations of input parameters the optiondatatypewill be set to"xml"to stay the mostly compatible to jqGrid 4.7.0 and older. -
dynamic default value is used now for
rowNumoption. The default valuerowNum: 20will be changed to10000(the value of the newmaxRowNumproperty) if no pager exists in jqGrid (nopagerandtoppager: trueoption are used) or if one uses jqGrid option, which switches off the pagination (liketreeGrid: true). New jqGrid optionmaxRowNumcan be used to change the maximal value of rows displayed in the grid from default value10000to another value. By the way jqGrid allow now to specifyrowNum: 0orrowNum: 0. In the case jqGrid replaces therowNumvalue tomaxRowNumduring initialization of the grid.
jqGrid 4.7 and earlier don't support the usage of datatype: "local", but it's known the trick which allows to do almost the same using datatype: "jsonstring". jqGrid uses the same trick and changes the input options datatype: "local" and input data option to datatype: "jsonstring" and datastr option. It simplify the usage of local TreeGrid.