Changes.txt 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160
  1. 3.6 version
  2. ===========
  3. Bug Fixes
  4. ---------
  5. * Fix problem with getAbsoluteIndex on IE8
  6. * Fix in triggerReload grid to reset the savedRow array.
  7. * Fix in setGridWidth method when try to resize a grid a and there is no data.
  8. * Fix header aligment in ie8
  9. * Fix in createEl function to check for val and not for html when select
  10. * making getChangedCells method compatible with unformat function if defined
  11. * Fixed record count when scroll true
  12. * Fix in setSelection method to accept numbers
  13. * Fix IE header checkbox when multiselect is true
  14. * Fix for searching DOM elements with id containing special characters
  15. * Fix a checkbox checking in form editing module.
  16. * Fix getCol to use unformat function
  17. * Better looking buttons in form editing
  18. * Fix searchFilter in IE7 and IE6 not to return undefined value when more
  19. than one field is searched.
  20. * Some fixes for datepicker UI in inline and cell edit (when present)
  21. * Fix in setLabel method not to clear the sort icons when we set new label
  22. * Fix in form edit when a formatter select is used
  23. * Fix the id pollution when multiselect is enabled. Now the id of every
  24. common multiselect is combination of cb_ + id of the grid
  25. * Fixed bug when deselectAfterSort false and we are in multiselect mode
  26. * Fix in unformat number and currency
  27. * Fixed bug when creating a select with dataUrl and select is set to multiple.
  28. * Fix a bug when creating select with multiple option. Also the attribute
  29. should be set immediatley after the element is created and not after.
  30. * Fix a bug in form edit. The comapared values should be trimed since of
  31. split(",") which cause the elements to begin with space.
  32. * Fix a jqGrid loader (development version) for IE browsers
  33. * Fix for form icons in Opera
  34. * Fix getGridParam to return values 0 or false
  35. * Avoiding the overhead of local functions and maintenance issues when the
  36. parameters change
  37. * Opera fix for cursor col-resize
  38. * Fix in editGridRow when a save key is defined and the key is Eneter we
  39. should not do save when we are in teaxtarea element
  40. * Fix in formatter checkbox when the value is undefined. We also add a
  41. default format for the checkbox too
  42. * Fix addRowData to use key:true (keyIndex) when rowid is not defined
  43. * Fix formatter bug for the select to use the defaultFormat
  44. * Adding a 3 parameter to the unformat function - the cellobject.
  45. * Fix alternate rows when we sort data locally.
  46. * Fix in addRowData for alternate rows when we add item as last
  47. * Fix collapseRow in treegrid preventing infinite recursion
  48. * Fix in stripHtml function to parse numeric values
  49. * Fix in delGridRow to get "fresh" Data from delData object
  50. * Fix problems with width option if set as string.
  51. * Fixing $jgrid.format function in base module to accept undefined parameter.
  52. * Fix for saveRow method in aftersave function. Also we pass the request and
  53. not the responseText. Also both aftersave and success functions have the
  54. same type parameter - the response
  55. * Fix for serchhidden in searchGrid method
  56. * Fix for setGridWidth method
  57. * Fix setColWidth function
  58. * Fix for topinfo and bottom info in formedit to appear separatley in edit and add dialogs
  59. * Fix searchFilter css to work when called from subgrid
  60. * Fix celledit to work better when datepicker is attached
  61. * Fix in viewGrid row to vizualize only the columns that only not hidden.
  62. Additions and changes
  63. ---------------------
  64. * New API
  65. * RTL Support
  66. * Column reordering
  67. * Added life scrolling of data
  68. * Added gridResize method which can resize the grid. Also use a jQuery UI
  69. resizable and can use any options of this widget
  70. * Added sortableRows method which allow us to sort rows with drag and drop
  71. * Added gridDnD method. The method connect two or more grids so that drag and drop rows
  72. between these is possible
  73. * Add columnChooser method which allows choosing/sorting columns at the same
  74. time. This method requiere multiselect plugin
  75. * Now getRowData can return all rows when rowid is not set.
  76. * getCol now can return summary, average and count of the selected row. The
  77. 3 parameter determines this (valid are sum, avg, count). If this parameter
  78. is set and is valid, the returned value is a scalar.If the param is not
  79. valid the returned value is empty array.
  80. * To setRowData we add a 3 parameter. If the parameter is string we use
  81. addClass to add classes. If the parameter is object we use css to add css
  82. properties. Note that we can set properties and classes without data, in
  83. this case we should set data to false
  84. * Adding a event object to ondblClickRow and onRightClickRow events as 4 parameter
  85. * Add a ant based build system which allow us to minify the JS code
  86. * Added custom validation property in editing modules
  87. * Added possibility to create custom element in editing modules
  88. * Adding support to configure the ajax request in a way that user want. This
  89. is done in all modules where ajax is used.
  90. * Added class in cell edit and inline edit so that the cell or row can not
  91. be edited - the corresponding classes are 'not-editable-cell' and
  92. 'not-editable-row'.
  93. * Added Hebrew Translation
  94. * Added a beforeCheckValues event in editGridRow method. The execution is
  95. before checking the values. Should return object of the posted data.
  96. * Added Romanian translation
  97. * Added a property classes in colModel where we can attach classes to column.
  98. * info_dialog function can be used as separate modal dialog
  99. * Added a class ui-ellipsis in grid css file. Also work in FireFox too.
  100. * Changind the order of calling the events beforeSearch and beforeClear in
  101. filterToolbar method. Also the events are called immediatley after triggering the grid
  102. * To onCellSelect we replace the 4 parameter with the more natuaral event instead of e.target -
  103. sorry if this will bring to some confusions.
  104. * Added searchoptions value parameter in order to separate the editing module and search module.
  105. We first look for such option in searchoptions and if not found we use the
  106. editoptions value
  107. * Added fixed property in colModel which allow us not to change the
  108. column width if shrinkToFit is true and we set new width of the grid.
  109. * Added buildSelect function to deserialize data for the select. This is option
  110. can be added in editoptions or search options
  111. Please read The Installation instructions first in install.txt
  112. ================================================
  113. 3.5 beta (buld6- build11)
  114. New Properties and methods
  115. ==========================
  116. - Added new grid parameter hoverrows. When set to false the mouse hovering is
  117. disabled in the grid data rows.
  118. - Added rowid as parameter to error function in saveRow method - inline
  119. editing module
  120. - treeGrid to be initially work with datatype local
  121. - Added new method updateGridRows (grid.custom.js)
  122. This method update the existing data in the grid by given id rowname.
  123. Syntax: updateGridRows (data, rowidname, jsonreader)
  124. data is a array of data in format
  125. [{name:value,name1:value1...},{name:value,name2:value2...}]
  126. where the name is the name from colModel and value is the actuall value.
  127. It is not neccessary that all columns are present in the data item object
  128. (the same as setRowData method)
  129. rowidname (string) - is the name of the row which should acts as id.
  130. If not set the name "id" is used.
  131. jsonreader (boolean) default false. If set to true a jsonReader definition
  132. is used to set the data. Note that this work only of the item in jsonReader
  133. object 'repeatitems' is set to true.
  134. - Switch to namedItems JS function. This improve the speed. Previously we
  135. walk throught the entry rowset to find the rowIndex of the given rowid.
  136. Now we use the build in javaScript method namedItems which do the same.
  137. - multiselect is enabled in inline edit module.
  138. - To the importComplete event in jqGridImport method we pass the response.
  139. - Added support for alternate rows. Also added new jqGrid option altclass.
  140. The default value is 'ui-priority-secondary' THis way we can develop our own
  141. alternate class.
  142. - Added ShrinkToFit option in setColumns method which fit columns to the grid
  143. width. Default value is false.
  144. - Extend tableToGrid method to use custom options when building the grid.
  145. The call to this function is
  146. tableToGrid(selector, options)
  147. where options is the object with jqGrid options.
  148. - Adding 4px right to the view records text for better view
  149. - Add a onClose event to all modals in form editing (except alert dialog)
  150. The default value is null. This event can be passed in editGridRow, delGridRow,
  151. viewGridRow, and setColumns methods. The event raised when a close icon is clicked,
  152. a cancel button is clicked or ESC key is pressed (if this is enabled).
  153. - Significant speed improvents in tree Grid when a relative large data is loaded.
  154. - Added dataheight parameter to all modal windows, where we can control the
  155. scrolling content. Intitially this parameter is auto.
  156. To summarize - we have two parameters for controlling the height of the modal.
  157. height and dataheight.
  158. The height parameter control the height of the entry modal, dataheight parameter
  159. control the height of the scrolling content. The buttons of the modals are
  160. allways visible at the bottom of the modal.Also some improvments in jqDnR.
  161. - In setColumns method we add colnameview and closeAfterSubmit parameters. The
  162. colnameview (default true). If set to false the names from colModel are not
  163. visible. closeAfterSubmit if defined cleses the dialog after the submit
  164. button is clicked.
  165. - Added parameter viewsortcols in jqGrid parameters. The purpose of this
  166. parameter is to define different look and behavior of sorting icons that
  167. appear near the header. This parameter is array with the following default
  168. options
  169. viewsortcols : [false,'vertical',true]
  170. The first parameter determines if all icons should be viewed at the same time
  171. when all columns have sort property set to true.
  172. The default of false determines that only the icons of the current sorting column
  173. should be viewed.
  174. Setting this parameter to true causes all icons in all sortable columns to be viewed.
  175. The second parameter determines how icons should be placed - vertical means that
  176. the sorting icons are one under another. 'horizontal' means that the icons should
  177. be one near other.
  178. The third parameter determines the click functionality. If set to true the columns are
  179. sorted if the header is clicked. If set to false the columns are sorted only when
  180. the icons are clicked.
  181. Important note: When set a third parameter to false be a sure that the first parameter
  182. is set to true, otherwise you will lost the sorting.
  183. Fixes
  184. =====
  185. - Fixed bug in filterToolbar. We search now by index and when not found by
  186. name.
  187. - Fix in searchGrid method. We search now by index and when not found by
  188. name.
  189. - Fixed bug in IE when resizing columns. The function getOffset is changed
  190. so that the resizing speed is the same as in Safari and FF.
  191. - Fix multiple select bug in createEl function. Now we set the options before
  192. checking for multiple:true
  193. - Fixed bug in treegrid. The strict comparation in getNodeParent method
  194. causes bad results.
  195. - Fix in setGridWidth method. We do not initialize correct the new width which
  196. causes after the first set of the width to not work in other grid in the same
  197. page.
  198. - Fixed bug in GridExport. We delete the columns that are generated
  199. dynamically - multiselect, subgrid, treegrid or rownumbers. This way the
  200. import is without errors
  201. - Fixed a bug in addRowData method to add data with id = 0 (number)
  202. - Fixed a forever loading bug in IE.
  203. - Fixed altRows bug in delRowData method
  204. - navGrid method fix for warning modal and IE6
  205. - Fix setColumns method to the common apprach of forms and modals
  206. - Fix for IE8 in getAbsoluteIndex method. IE8 seems to work as other browsers
  207. - Fixed bug in delRowData - the grid does not resize when first row is
  208. deleted.
  209. - Fixed bug when rownumbers and subgrid are used together
  210. - Fixed bug in row editing when the column name contain dot.
  211. - Fixing bug in viewGridRow - also the id manes of the form are changed in order
  212. to be not equal of those in editGridRow
  213. 3.5 beta (buld5)
  214. FormEditing
  215. ===========
  216. - added options checkOnUpdate (default false) in editGridRow method.
  217. Also available in add and edit mode.
  218. When this option is set to true the behaviour as follow:
  219. When something is changed in the form and the user click on
  220. Cancel button, navigator buttons, close button (on upper right corner of the
  221. form), in overlay (if available) or press Esc key (if set) a message box apper
  222. asking the user to save the changes, not to save the changes and go back in the
  223. form or cancel all changes (this will close the modal form)
  224. Note that checkOnSubmit option will work only when a submit button is clicked.
  225. When nothing is changed we contionue with the action.
  226. - added option - rowabove (default false) in colModel formoptions
  227. When set to true a new empty row is added above this row in form editing.
  228. - added option - rowcontent (default empty) in colModel formoptions.
  229. This option have sense only when rowabove option is set to true.
  230. With this option is possible to set a content to the new added empty row in
  231. the form. In order to style easy these rows a class 'contentinfo' is set.
  232. - added new items in the language files to support the checkOnUpdate option
  233. - added class 'delmsg' in the delGridRow method. This allow us to change the
  234. message dynamically using a beforeShow or afterSow eventrs. The class is added
  235. to a element td.
  236. Fixes
  237. =====
  238. - fix in Bulgarian translations files.
  239. - fix in searchGrid method. Now we search by index (from colModel) and only if
  240. it is not available we search by name.
  241. - Fix for date parser in the base module. Now we can sort locally on
  242. dates that contain month names
  243. - Fixed bug in searchGrid. The translation messages for the operations does not
  244. apper when not set in colModel
  245. - removed some not needed events from base grid. Also return false do these
  246. by default;
  247. - Fix bug to check if datepicker is available in searchGrid.
  248. - Fix a bug in searchGrid in IE6, where the data value is not set for elements
  249. after the first
  250. - Fixed bug when calling of jqModal multiple times on the same element. We
  251. need the initialization only once and not every time. This cause a memory
  252. leaks
  253. - Fixed bug in formatter where the data containing ' causes break in IE
  254. - Fixed bug in base module when adding data where the data contain a ' char.
  255. This breaks in IE browsers.
  256. - Fixed bug in checkboxes. We add the value setted in the editoptions. Also
  257. converting to lower case make the option checkOnUpdate to be true every time.
  258. - We replace white-space nowrap with pre in td element in the CSS file. This fixes
  259. the bug in IE where the first row does not wrap when the text is longer than
  260. the column width. Also this requiere DOCTYPE declaration in the document.
  261. - Fixed bug in viewGridRow method where when resizing the modal causes the data
  262. to apper bad.
  263. 3.5 beta (buld4)
  264. Base
  265. ====
  266. - added option footerrow - default false. If set to true this will place a
  267. footer table with one row below the gird records and above the pager.
  268. The number of columns equal of these from colModel
  269. -added option userDataOnFooter(default false) which directly place the user data
  270. array at footer. The rules are as follow: If the userData array contain name
  271. which is equal to those of colModel then the value is placed in that column.
  272. If there are no such values nothing is palced. Note that if this option
  273. is used we use the current formatter options (if available) for that column.
  274. -Added method getCol(colname). Colname can be either number which represents
  275. the index of the column or name from colModel. The method return array with
  276. the values of the coulmn.
  277. - Added method footerData ( action, data, format). This method get or set data
  278. on footer.
  279. action - can be 'get' or 'set'. If not set default is get.
  280. When set to 'get' - the result is object of type name:value, where the name is
  281. a name from colModel. This will return a data from the footer. The other two
  282. options does not have effect in this case.
  283. When set to 'set' a data array (object) should be set. This will place
  284. the values in the footer.
  285. format - default is true. This instruct the method to use the formmater
  286. (if set in colModel) when a new values are set.
  287. Setting to false will disable the using of formatter.
  288. Related css items in the ui.jqgrid.css
  289. .ui-jqgrid-sdiv - is a div container for the footer
  290. .ui-jqgrid-ftable - is the class for the table
  291. tr.footrow - is the class for the footer row
  292. tr.footrow td is the item for the cell formating
  293. In order to format every cell in a way that you want
  294. maybe you can use
  295. jQuery("tr.footrow td:eq(2)","#gbox_mygrid").css(...)
  296. where the td:eq(2) point to the third column
  297. and mygrid is the id of the grid. The id of the global grid container
  298. is constructed via "gbox_"+the id of the grid.
  299. There are no methods to show and hide the footer row dynamically, but
  300. following the above example we can do
  301. jQuery(".ui-jqgrid-sdiv","#gbox_mygrid").hide() - this will hide the footer row.
  302. jQuery(".ui-jqgrid-sdiv","#gbox_mygrid").show() - this will show the footer row.
  303. Form Editing
  304. ============
  305. aded option in editGridRow - checkOnSubmit (default false)
  306. This option only work in editing mode and not in add.
  307. When set to true - the method looks if any data is changed in the form and
  308. if this is a case a dilog message appear where the user is asked to confirm the
  309. changes or cancel it. Pressing cancel will return to the form, but does not
  310. set the values to its original state.
  311. Note that this causes a some changes in the language file.
  312. Fixes
  313. =====
  314. - Removed imgpath from cell edit and inline edit modules and common module.
  315. This parameter is no longer valid in 3.5
  316. - Replace $ with jQuery in grid.common.js which causes problems when used with
  317. other librariers like prototype.
  318. - removed a checking e.srcElement from base module. jQuery allready fix this.
  319. - fixing the size option in select when using ajax to load selects.
  320. - Fixed bug in IE browsers, when clicked on href tag with child nodes,
  321. IE incorrect report in all cases that this is a href element. This couses
  322. onSelectCell not to behave correct.
  323. - Fixed bug in searchGrid - group options are not passed to serchFilter in
  324. order get them from Language file.
  325. - Fix in bulgarian trnslations.
  326. - Fix on sorting column. The initial sort check first for index and then for
  327. column name. Before the checking for the index was missed.
  328. Sortorder converted to lower case in order to avoid some cofusions.
  329. - Fix in set columns module. The modal does not appear correctly due to
  330. missed parameter
  331. 3.5 beta (buld3)
  332. Base
  333. ====
  334. - To the loading message is added ui-state-active class from Theme roller.
  335. This is more natural, indicating that the grid is active when data is loaded.
  336. Form Editing
  337. ============
  338. - Added keyboard navigation, which allow us to navigate throught the records while
  339. in form editing pressing certain keys. This option is available in editGridRow
  340. and viewGridRow methods. The default state is disabled. To enable this you
  341. should set the options in the edit/add parameters:
  342. navkeys: [true,38,40]
  343. The first item enables the navigation.
  344. The second item corresponds to reccord up and by default is the the key code
  345. for Up key
  346. The third item corresponds to reccord down and by default is the key code for
  347. Down key
  348. Example
  349. $("#mygrid").navGrid("#pager",{options},{id:'myeditid',navkeys: [true,38,40]}..)
  350. Also this option does not work in add mode.
  351. Note: Instead that this does not have sense, if you plan to navigate with keys
  352. it is recommended to add this option in add mode. This should be done
  353. because the form for add and edit is the same and it is unknown which action
  354. will be lunched first.
  355. - Added posibility to save the form pressing certain key - add/edit mode only
  356. By default this option is disabled.
  357. To enable
  358. savekey: [true,13]
  359. The first item enables saving with pressing certain key.
  360. The second item corresponds to key code for saving. Default Enter (key code 13)
  361. Note that this binding should be used for both adding and editing a row.
  362. Since the binding is for the form, there is no possibility to have one
  363. key in add and another in edit mode.
  364. - Added icons for the buttons in the form. The corresponding class in the css
  365. is "fm-button"
  366. By default all icons are enabled.
  367. For add/edit method editGridRow
  368. The save button is defined with
  369. saveicon : [true,"left","ui-icon-disk"]
  370. The close button is defined with
  371. closeicon: [true,"left","ui-icon-close"]
  372. The first item enables the icon
  373. The second item tells where to pu icon left or right
  374. The third item corresponds to valid ui icon from theme roller
  375. For viewGrid Row
  376. closeicon : [true,"left","ui-icon-close"]
  377. For Deleting
  378. delicon: [true,"left","ui-icon-scissors"]
  379. cancelicon: [true,"left","ui-icon-cancel"]
  380. Fixes
  381. ======
  382. -Fixed bug when getting the index of the row. Strict compare should be removed.
  383. -Fixed bug when datatype is function - we need to exit when call it and not to
  384. continue.
  385. -Fixed bug in form editing - the buttons do not align properly.
  386. 3.5 beta (build2)
  387. Navigator
  388. =========
  389. This was missed in the first build
  390. In the navGrid we can pass uniquie id's of the buttons in order to manipulate
  391. them easy. If no id is set we create one which is combination of:
  392. for add button "add_"+ the id of the grid
  393. for edit button "edit_"+ the id of the grid
  394. for view button "view_" + the id of the grid
  395. for delete button "del_" + the id of the grid
  396. for search button "search_" + the id of the grid
  397. for refresh button "refresh_" + the id of the grid
  398. Example:
  399. $("#mygrid").navGrid("#pager",{options}, {id:'myeditid'},{id:'myaddid'}...)
  400. Base Grid
  401. =========
  402. - Record number information now can format the values according to the
  403. formatter setting (if available) getting information from language file.
  404. Fixes
  405. =====
  406. - Fixed bug when multi select with json. We pass wrong parameter to addMulti
  407. function
  408. - Spelling error in all language files, which cause not to set the default
  409. value correct
  410. - Fixed bug when creating warning message. Fixed bug when determining the
  411. number column element in the form
  412. - Fixed bug - clientSide datatype should be converted to lower case
  413. according to the new improvements
  414. - Fixed bug in IE6/7 when try to select a option in the select generated via
  415. ajax
  416. ===============================
  417. Upgrade from 3.4.x to 3.5 beta.
  418. ===============================
  419. 1. Installation
  420. --------------
  421. See install.txt
  422. 2. Code changes
  423. ---------------
  424. 2.1 The following grid options are deprecated - i.e. you can remove them from
  425. the grid options. They are not needed in 3.5 version
  426. imgpath
  427. sortascimg
  428. sortdescimg
  429. firstimg
  430. previmg
  431. nextimg
  432. lastimg
  433. sortclass
  434. resizeclass
  435. 2.2 Second change is related to custom formatters. Starting with version 3.5,
  436. the custom formatter is passed the following parameters:
  437. formatter : function ( cellvalue, options, rowObject )
  438. {
  439. // format the cellvalue to new format
  440. return new_formated_cellvalue;
  441. }
  442. Note the return in the function. This function should always return a value
  443. in order to work correctly. The parameters are
  444. cellvalue - is the value to be formatted
  445. options - is an object containing the following element
  446. options : { rowId: rid, colModel: cm}
  447. where rid - is the id of the row
  448. colModel is the object of the properties for this column getted from colModel
  449. array of jqGrid
  450. rowObject - is a row data represented in the format determined from datatype
  451. option.
  452. If we have datatype: xml/xmlstring - the rowObject is xml node,provided
  453. according to the rules from xmlReader
  454. If we have datatype: json/jsonstring - the rowObject is array, provided
  455. according to the rules from jsonReader
  456. Example:
  457. Code in 3.4.x variant
  458. formatter : function ( elem, cellvalue, options)
  459. {
  460. var newval = "<strong>"+cellvalue+"</strong>";
  461. jQuery(elem).html(newval);
  462. }
  463. Code in 3.5
  464. formatter : function ( cellvalue, options, rowObject )
  465. {
  466. return "<strong>"+cellvalue+"</strong>";
  467. }
  468. Base Module
  469. ============
  470. Bug fixes
  471. ---------
  472. - fixed bug in onCellSelect event when used in IE browsers - now the rowIndex
  473. passed to this event is calculated correctly regardless of hidden columns.
  474. - fixed width bug when multiselect is used. Previously the width of this column
  475. is recalculated according to table width and when shrinkToFit is set to true.
  476. Now the column has fixed width and is no longer recalculated when the grid
  477. width is changed. See documentation for the new options
  478. - fixed width bug when subgrid is used. Previously the width of this column is
  479. recalculated according to table width and when shrinkToFit is set to true. Now
  480. the column has fixed width and is no longer recalculated when the grid width
  481. is changed. See documentation for the new options
  482. - fixed bug in addRowData method when the grid is empty and we try to add one
  483. or more columns. The width of the data was not being recalculated correctly,
  484. according to the header elements.
  485. - fixed bug when we use xmlstring and jsonstring to add data. Previously all
  486. the data from the string is loaded without reference to the rowNum parameter.
  487. Also this behaviour is changed for xml and json data. In other words, we now
  488. load only rowNum number of rows even when the request consists of more rows.
  489. - fixed bug when posting values of input of type select set to multiple:true.
  490. Now in all editing modules the posted values in for multiselect are separated
  491. with comma
  492. - fixed bug in the size option of multi select. If the size option is not set
  493. for multiselect the default value is 3
  494. Deprecated options
  495. ----------------
  496. imgpath: "", in all modules
  497. sortascimg: "sort_asc.gif",
  498. sortdescimg: "sort_desc.gif",
  499. firstimg: "first.gif",
  500. previmg: "prev.gif",
  501. nextimg: "next.gif",
  502. lastimg: "last.gif",
  503. sortclass: "grid_sort",
  504. resizeclass: "grid_resize",
  505. Note that imgpath is not used anymore in all modules.
  506. The altRows option is still here, but will have no effect until the jQuery
  507. UI Theme roller supports alternative rows.
  508. Note that the table element where we define the grid can not have a class
  509. scroll - i.e. class scroll in the table definition can be omitted, but this
  510. is NOT true for the pager element.
  511. New options
  512. -----------
  513. datatype can now set as 'script'. In other words, we now support script
  514. as datatype.
  515. reccount: numeric, Default 0. Determines the exact number of available
  516. grid rows. Can be <= from rowNum parameter
  517. autowidth: boolean, Default false. When set to true, the grid width is
  518. recalculated automatically to the width of the parent element. This is done
  519. only initially when the grid is created. In order to resize the grid when
  520. the parent element changes width you should apply custom code and use a
  521. setGridWidth method for this purpose.
  522. scrollOffset: numeric, Default 18. Determines the width of the vertical
  523. scrollbar. Since different browsers interpret this width differently (and it
  524. is difficult to calculate it in all browsers) this can be changed.
  525. cellLayout: numeric, Default 5. This option determines the padding + border
  526. width of the cell. Usually this should not be changed, but if custom changes
  527. to td element are made in the grid css file this will need to be changed.
  528. subGridWidth: numeric, Default 20. Determines the width of the subgrid column
  529. if the subGrid option is set to true.
  530. multiselectWidth: numeric, Default 20. Determines the width of the multiselect
  531. column if multiselect is set to true.
  532. rownumbers: boolean, Default false. If this option is set to true, a new column
  533. at left of the grid is added. The purpose of this column is to count the number
  534. of available rows, beginning from 1. In this case colModel is extended
  535. automatically with new element with name - 'rn'. Also, be careful not to use
  536. the name 'rn' in colModel
  537. rownumWidth: numeric, Default 25. Determines the width of the row number column
  538. if rownumbers option is set to true.
  539. pagerpos: string, Default 'center'. Determines the position of the pager in the
  540. grid. By default the pager element when created is divided in 3 parts (one part
  541. for pager, one part for navigator buttons and one part for record information)
  542. recordpos: string, Default 'right'. Determines the position of the record
  543. information in the pager.
  544. toolbar now accepts another option: "both". When we set toolbar: [true,"both"]
  545. two toolbars are created -- one on the top of table data and one of the bottom
  546. of the table data. When we have two toolbars then we create two elements (div).
  547. The id of the top bar is constructed like "t_"+id of the grid and the bottom
  548. toolbar the id is "tb_"+id of the grid. In case when only one toolbar is
  549. created we have the id as "t_" + id of the grid, independent of where this
  550. toolbar is created (top or bottom)
  551. gridview: boolean, Default value false. In the previous versions of jqGrid,
  552. including 3.5 alfa, reading a relatively big data sets (Rows >=100 ) caused
  553. speed problems. The reason for this was that as every cell was inserted into
  554. the grid we applied about 5-6 jQuery calls to it. Now this problem is resolved;
  555. we now insert the entry row at once with a jQuery append. The result is
  556. impressive - about 3-5 times faster. What will be the result if we insert all
  557. the data at once? Yes, this can be done with a help of gridview option when set
  558. to true. The result is a grid that is 5 to 10 times faster. Of course when this
  559. option is set to true we have some limitations. If set to true we can not use
  560. - treeGrid
  561. - subGrid, or
  562. - afterInsertRow event.
  563. If you do not use these three options in the grid you can set this option to
  564. true and enjoy the speed.
  565. addRowData now is 1-2 times faster because we are using the concept to insert
  566. the row at once
  567. Added jQuery function parse (removed from json2.js module):
  568. jQuery.parse(jsonstring)
  569. To prevent JavaScript hijacking attacks, web application authors are encouraged
  570. to use this function. This returns a JSON representation of the variable.
  571. Cyclic structures are detected and safely interrupted, but could not be further
  572. restored.
  573. 1. The while(1); construct, located at the beginning of JSON text,
  574. 2. Comments at the beginning and end of the text.
  575. JSON data providers are encouraged to use one or both of these methods to
  576. prevent data execution. Such JSON response may then look like this:
  577. while(1);/*{[
  578. {"name":"safe value 1"},
  579. {"name":"safe value 2"},
  580. ...
  581. ]}*/
  582. jqGrid uses this function when obtaining a data with datatype:'json', also used
  583. in subGrid.
  584. Added jQuery function stringToDoc: jQuery.stringToDoc(xmlstring). This returns
  585. the xml document of xml string
  586. Added new method: jQuery("#mygrid").updateColumns(); this synchronizes the
  587. width of the headers with the data. Useful when used with table drag and drop.
  588. colModel changes and additions
  589. ------------------------------
  590. searchhidden is removed from editrules object
  591. added searchoptions object to define properties, events and other settings when
  592. a search is performed
  593. searchoptions : {
  594. dataUrl : value,
  595. dataInit: function,
  596. dataEvents : array,
  597. defaultValue: value,
  598. attr: object,
  599. searchhidden: boolean,
  600. sopt: array
  601. }
  602. To summarize - when we want to deal with search we should use the following
  603. options in colModel
  604. search : boolean , // true/false
  605. stype: value, // text/select
  606. searchoptions : object // see above
  607. Note: when the dataUrl is not used for the search type select, the definitions
  608. for the select are taken from editoptions value property - i.e
  609. editoptions:{value:"1:one;2:two",...}. See below for how to use these options in
  610. different search methods.
  611. Added new object formoptions to define various settings in form editing. Also
  612. valid only in this module.
  613. formoptions : {
  614. elmprefix:value,
  615. elmsuffix:value,
  616. rowpos: number,
  617. colpos:number,
  618. label: value
  619. }
  620. See below for how to use
  621. The editoptions are extended with the following properties. Valid in all editing
  622. modules editoptions : {
  623. dataUrl : value, dataInit: function, dataEvents : array, defaultValue:
  624. value/function,
  625. } See below
  626. Changes in all editing modules
  627. ==============================
  628. edittype property is extended with the support of the following input elements:
  629. button, image and file
  630. As described above in all editing modules we can add additional properties and
  631. events to the editing element:
  632. editoptions : {
  633. dataUrl : value, dataInit: function, dataEvents : array, defaultValue:
  634. value/function
  635. }
  636. -------------------------------------------------------------------------------
  637. dataUrl option is valid only for the elements of type select - i.e.,
  638. edittype:select
  639. When this option is set, the element will be filled with values from the ajax
  640. request. The data should be a valid html select element with the desired
  641. options. <select>
  642. <option value="1">One</option> <option value="2">Two</option>
  643. </select>
  644. In form editing for add/edit this is called only once. In order to call it every
  645. time the form is launched you should set the option recreateForm:true or use
  646. other events like beforeShowForm (with another custom ajax call) to fill the
  647. desired element.
  648. In inline edit and cell edit this is fired every time you edit the row or cell
  649. element.
  650. --------------------------------------------------------------------------------
  651. dataInit : function (elem) {
  652. // do something
  653. }
  654. If set, this function is called only once ? when the element is created. The
  655. function is passed the specified element. This option is ideal for attaching
  656. date picker, time picker, etc. Example:
  657. dataInit : function (elem) {
  658. $(elem).datepicker();
  659. }
  660. --------------------------------------------------------------------------------
  661. dataEvents: list of events to apply to the data element; uses
  662. $("#id").bind(type, [data], fn) to bind events to data element
  663. Should be described like this dataEvents: [
  664. { type: 'click', data: { i: 7 }, fn: function(e) { console.log(e.data.i); }
  665. }, { type: 'keypress', fn: function(e) { console.log('keypress'); } }
  666. ]
  667. The event(s) are called only once when the element is created
  668. -------------------------------------------------------------------------------
  669. defaultValue: 'value' or function This option is valid only in Form Editing
  670. module when used with editGridRow method in add mode.If set this the input
  671. element is set with this value if only element is empty. If used in selects the
  672. text should be provided and not the key. Also when a function is used the
  673. function should return value.
  674. Now we can validate a url. The corresponding settings is in colModel
  675. editrules:{required:true, url:true}
  676. FormEditing
  677. ===========
  678. In all methods that deal with the modals are added the following options (thanks
  679. to Faserline Team: www.faserline.com)
  680. jqModal: true. The default value is true. How it works. If set to true, first
  681. jqGrid checks if the jqModal plugin is available. If this plugin is available we
  682. create the modal according to the jqModal plugin. If this plugin is not
  683. available jqGrid create its own modal. The difference between the jqModal window
  684. and jqGrid modal window is that the overlay covers only the grid, but not the
  685. entry page as jqModal does. If this option is set to false, jqGrid will create
  686. its own modal as described above even if jqModal is available.
  687. The only exception here is searchGrid method created with the new searchFilter
  688. plugin, where this option is not available. In this method a jqGrid modal window
  689. is used.
  690. closeOnEscape : false. Default false. When set to true the modal window can be
  691. closed with ESC key.
  692. =======searchGrid==================
  693. From now on jqGrid use a new search engine
  694. thanks to wonderful plugin provided from Kasey Speakman (kasey@cornerspeed.com).
  695. This plugin can also be used separately. Detailed documentation is provided in
  696. the jquery.searchFilter.js which is provided with jqGrid package.
  697. These options are not used anymore in the searchGrid method
  698. ----------------------------------------------------------
  699. top : 0,
  700. left: 0,
  701. width: 360,
  702. height: 80,
  703. modal: false,
  704. closeicon: 'ico-close.gif',
  705. dirty: false,
  706. processData: "",
  707. Added the following options
  708. ---------------------------
  709. recreateFilter: false, This option construct the filter every time a search
  710. button is clicked.
  711. multipleSearch : false, When set to false the behaviour of the search is the
  712. same as those in versions before 3.5 When set to true: 1. We have a possibility
  713. to add/delete as many conditions as we want 2. The posted data to the server is
  714. string (actually a json array converted to string)
  715. sFilter: 'filters', This option has an effect only when the multipleSearch is
  716. set to true; it describes the name of the posted string. By default this, i.e.
  717. the posted data, can look like this
  718. filters ={
  719. "groupOp":"AND","rules":[{"field":"id","op":"gt","data":"1"},
  720. {"field":"name","op":"bw","data":"Client"}]
  721. }
  722. groupOp determines the logical operator that can be used in the where statement
  723. of the select. The value can be AND or OR. This can be changed used a select box
  724. which is created at bottom of the search filter.
  725. The rules array describes actually which fields and how they are included in the
  726. where clause The field element describes the name of the field The op element
  727. describes the operator that should be used in the search The data element is the
  728. data that we want to search.
  729. The above example (if getted and constructed correctly) should generate the
  730. following where clause
  731. SELECT .... FROM table,... WHERE id > 1 AND name LIKE 'Client%'
  732. -------------------------------------------------------------------------------
  733. As described above the search is constructed according to the searchoptions in
  734. colModel
  735. search : boolean , // true/false stype: value, // text/select
  736. searchoptions : {
  737. dataUrl : value,
  738. dataInit: function,
  739. dataEvents : array,
  740. attr: object,
  741. searchhidden: boolean,
  742. sopt: array
  743. }
  744. Note that here is missing the defaultValue. The option is not implemented in
  745. this method.
  746. stype determines the search type - can be select or text. If not set a text is
  747. used
  748. searchoptions
  749. -------------------------------------------------------------------------------
  750. dataUrl option is valid only for the elements of type select, i.e.
  751. edittype:select
  752. When this option is set the element will be filled with values from the ajax
  753. request. The data should be a valid html select element with the desired
  754. options. <select>
  755. <option value="1">One</option> <option value="2">Two</option>
  756. </select>
  757. This is called only once.
  758. -------------------------------------------------------------------------------
  759. dataInit : function (elem) {
  760. // do something
  761. }
  762. If set this function is called only once when the element is created. To the
  763. function is passed the element. Also this option is ideal for attaching date
  764. picker, time picker and etc. Example
  765. dataInit : function (elem) {
  766. $(elem).datepicker();
  767. }
  768. --------------------------------------------------------------------------------
  769. dataEvents: list of events to apply to the data element; uses
  770. $("#id").bind(type, [data], fn) to bind events to data element
  771. Should be described like this
  772. dataEvents: [
  773. { type: 'click', data: { i: 7 }, fn: function(e) { console.log(e.data.i); }},
  774. { type: 'keypress', fn: function(e) { console.log('keypress'); } }
  775. ]
  776. The event(s) are called only once when the element is created
  777. --------------------------------------------------------------------------------
  778. attr is object where we can set valid attributes to the created element
  779. attr : { title: "Some title" }
  780. ------------------------------------------------------------------------------
  781. searchhidden : if set to true, the hidden element will appear in the search.
  782. -------------------------------------------------------------------------------
  783. array that correspond to the op element in the posted data and determines the
  784. operation. If not set all the available options will be used; if set only the
  785. set values will appear as selectboxes.
  786. All available option are sopt:
  787. ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
  788. The corresponding texts are in language file and mean the following ['equal',
  789. 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins
  790. with','does not begin with','is in','is not in','ends with','does not end
  791. with','contains','does not contain'],
  792. Note that the elements in sopt array can be mixed in any order.
  793. =========add/edit form==========
  794. In the editGridRow method the following options are no longer used
  795. closeicon: 'ico-close.gif',
  796. imgpath: ''
  797. Added new property formoptions (in colModel); thanks to Faserline Team
  798. (www.faserline.com)
  799. The purpose of these options is to reorder the elements in the form and to add
  800. some information before and after the editing element.
  801. formoptions : {
  802. elmprefix:'',
  803. elmsuffix:'',
  804. rowpos:number,
  805. colpos:number,
  806. label: value
  807. }
  808. If you go to use this object in collModel it is recommended that all editing
  809. fields use this property and with at least the rowpos and colpos set.
  810. Elemprefix: if set, a text or html content appears before the input element
  811. Elemsuffix: if set, a text or html content appears after the input element
  812. Label: if set, this replace the name from colNames array that appears as label
  813. in the form.
  814. rowpos : number determines the row position of the element (again with the
  815. text-label) in the form; the count begins from 1
  816. colpos : number determines the column position of the element (again with the
  817. label) in the form beginning from 1
  818. Two elements can have equal row position, but different column position. This
  819. will place the two elements in one row on the form.
  820. =========== delete=================================
  821. In the delGridRow method the following options are no longer used
  822. closeicon: 'ico-close.gif',
  823. imgpath: '',
  824. ============= view =============================
  825. Added viewGridRow method; thanks to Faserline Team (www.faserline.com)
  826. This method is similar to the editGridRow method except that the fields are not
  827. editable and we do not have any events attached to the form. Here are the
  828. options viewGridRow (options) where
  829. options = {
  830. top : 0,
  831. left: 0,
  832. width: 0,
  833. height: 0,
  834. modal: false,
  835. drag: true,
  836. closeOnEscape : false,
  837. labelswidth: '30%'
  838. }
  839. All the options have the same thing as these in editGridRow except the option
  840. labelswidth which default value is 30%. Since we construct the view with table
  841. element it is difficult to calculate, in this case, how much width is needed for
  842. the labels. Depending on the needs this value can be increased or decreased
  843. Custom method
  844. =============
  845. In the custom module is added new method filterToolbar.
  846. This method is the same as filterGrid, except that the search input elements are
  847. placed in the grid just below the header elements. When the header elements are
  848. resized the input search elements are also resized according to the new width.
  849. Another difference to the filterGrid is that the filter toolbar uses definitions
  850. from colModel just like the searchGrid
  851. Should be called like this
  852. jQuery("#mygrid").filterToolbar(options)
  853. where options are
  854. options = {
  855. autosearch: true,
  856. beforeSearch: null,
  857. afterSearch: null,
  858. beforeClear: null,
  859. afterClear: null,
  860. searchurl : ''
  861. }
  862. autosearch: true Search is performed according to the following rules For text
  863. element when a Enter key is pressed while inputting values a search is
  864. performed. For select element when the value changes.
  865. beforeSearch - event which fires before a search
  866. afterSearch - event which fires after a search
  867. beforeClear - event which fires before clearing entered values (i.e.,
  868. clearToolbar is activated)
  869. afterClear - event which fires after clearing entered values (i.e., clearToolbar
  870. is activated)
  871. The rules of creating toolbar search input elements are the same as searchGrid
  872. using the colModel
  873. searchoptions : {
  874. dataUrl : value,
  875. dataInit: function,
  876. dataEvents : array,
  877. defaultValue: value,
  878. attr: object
  879. }
  880. Note the missing sopt element, but addition of defaultValue property
  881. This method has 3 new additional methods that can be used:
  882. triggerToolbar - when called perform a search dynamically
  883. clearToolbar - when called clear the search values and set the default one if
  884. available
  885. toggleToolbar - toggles the searchbar
  886. A typical call to these methods
  887. var sgrid = $("#mygrid")[0] sgrid.triggerToolbar();
  888. will trigger the search of mygrid.
  889. Import module
  890. =============
  891. added option importComplete event which fires after constructing the grid.
  892. Inline edit
  893. ===========
  894. added afterrestorefunc as 9th parameter. The event fires after the row is
  895. restored
  896. treeGrid
  897. ========
  898. the tree icons can be changed using the following grid parameter treeIcons. The
  899. default values are.
  900. treeIcons ={
  901. plus:'ui-icon-triangle-1-e',
  902. minus:'ui-icon-triangle-1-s',
  903. leaf:'ui-icon-radio-off'
  904. };
  905. Note that icons from UI Theme should be used.
  906. formatter
  907. =========
  908. - the source format for date formatter (srcformat) now can accept month names
  909. - it is possible to enable checkboxes as editable when created with formatter In
  910. the format options we should in this case checkbox : {disabled:false} The
  911. default is false. To enable this option globally you can change this value in
  912. the language file
  913. - the showLink now can accept custom name for the id The parameter is idName :
  914. 'id' The default is id. Can be changed in formatoptions or in the language
  915. file.