Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:pivotsettings [2014/02/16 15:16]
tony
wiki:pivotsettings [2017/12/12 17:24] (current)
admin
Line 4: Line 4:
  
  
-jqPivotGrid has the following calling convention+jqPivotGrid has the following calling convention
  
 <code javascript>​ <code javascript>​
Line 158: Line 158:
 ==== ajaxoptions ==== ==== ajaxoptions ====
  
 +Additionally when the data is obtained via ajax we can set additional [[https://​api.jquery.com/​jQuery.ajax/​ |ajax options]].\\
 +Note that currently we support only JSON data, so some ajax options like //​dataType//​ is not recommended to be changed. Again with this we have a //reader// option which defines the root data. By example if the data that is returned from the server has the following structure:
  
 +<code javascript>​
 +{"​root":​[
 +{"​CategoryName":"​Beverages","​ProductName":"​Steeleye Stout","​Country":"​UK","​Price":"​1008.0000","​Quantity":"​65"​},​
 +{"​CategoryName":"​Beverages","​ProductName":"​Laughing Lumberjack Lager","​Country":"​USA","​Price":"​140.0000","​Quantity":"​10"​},​
 +{"​CategoryName":"​Beverages","​ProductName":"​Lakkalik","​Country":"​USA","​Price":"​2160.0000","​Quantity":"​120"​},​
 +...
 +]}
 +</​code>​
 +
 +In this case the setting should be like this
 +
 +<code javascript>​
 +jQuery("#​grid"​).jqGrid('​jqPivot', ​
 +   "​jsondataurl.json", ​
 +   ​{pivotoptions}, ​
 +   ​{gridoptions}, ​
 +   ​{ ​
 +     ​reader:"​root"​
 +   }
 +);
 +</​code>​
  

QR Code
QR Code wiki:pivotsettings (generated for current page)