Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:upgrade_from_3.4.x_to_3.5 [2009/11/28 08:08]
wiki:upgrade_from_3.4.x_to_3.5 [2009/11/28 08:08] (current)
Line 1: Line 1:
 +====== Upgrade from 3.4.x to 3.5 ======
 +===== Installation =====
 +The first change is related to installation. More detailed information can be found in [[:​wiki:​how_to_install | How to Install]]
 +===== Options =====
 +The following grid options are deprecated - i.e. you can remove them from the grid options. They are not needed in 3.5 version
 +  * imgpath
 +  * sortascimg
 +  * sortdescimg
 +  * firstimg
 +  * previmg
 +  * nextimg
 +  * lastimg
 +  * sortclass
 +  * resizeclass
 +===== Formatter =====
 +Another change is related to custom formatters. Starting with version 3.5,the custom formatter is passed the following parameters:
 +<code javascript>​
 +formatter : function ( cellvalue, options, rowObject )
 +{
 +// format the cellvalue to new format
 +return new_formated_cellvalue;​
 +}
 +</​code>​
  
 +Note the return in the function. This function should always return a value in order to work correctly. The parameters are
 +
 +  * cellvalue - is the value to be formatted (NOT A OBJECT)
 +  * options - is an object containing the following element
 +<code javascript>​
 + ​options :  { rowId: rid, colModel: cm}
 +</​code>​
 +where \\ 
 + ​**rowId** is a property containing the id of the row \\ 
 + ​**colModel** is the object of the properties for this column getted from colModel array of jqGrid \\ 
 +
 +  * rowObject - is a row data represented in the format determined from datatype option. If we have datatype: xml/​xmlstring - the rowObject is xml node,​provided according to the rules from xmlReader If we have datatype: json/​jsonstring - the rowObject is array, provided according to the rules from jsonReader
 +\\
 +Example: code in 3.4.x variant
 +<code javascript>​
 +formatter : function ( elem, cellvalue, options)
 +{
 +var newval = "<​strong>"​+cellvalue+"</​strong>";​
 +jQuery(elem).html(newval);​
 +}
 +</​code>​
 +\\ 
 +Code in 3.5
 +<code javascript>​
 +formatter : function ( cellvalue, options, rowObject )
 +{
 +return "<​strong>"​+cellvalue+"</​strong>";​
 +}
 +</​code>​

QR Code
QR Code wiki:upgrade_from_3.4.x_to_3.5 (generated for current page)