Upgrade from 3.4.x to 3.5

Installation

The first change is related to installation. More detailed information can be found in 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:

formatter : function ( cellvalue, options, rowObject )
{
// format the cellvalue to new format
return new_formated_cellvalue;
}

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
 options :  { rowId: rid, colModel: cm}

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

formatter : function ( elem, cellvalue, options)
{
var newval = "<strong>"+cellvalue+"</strong>";
jQuery(elem).html(newval);
}


Code in 3.5

formatter : function ( cellvalue, options, rowObject )
{
return "<strong>"+cellvalue+"</strong>";
}
You could leave a comment if you were logged in.

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