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 14:24]
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 48: Line 48:
  
 ^Property^Type^Description^Default^ ^Property^Type^Description^Default^
-|aggregates|array of objects|Defines the aggregates records and builds the pivot. The array should have at minimum one set of object and should always be defined. If no aggregates is set, the pivot will not be build. All properties of [[wiki:​colmodel_options | colModel]] can be set. For all available properties see below|empty| ​+|[[pivotsettings#​aggregates]]|array of objects|Defines the aggregates records and builds the pivot. The array should have at minimum one set of object and should always be defined. If no aggregates is set, the pivot will not be build. All properties of [[wiki:​colmodel_options | colModel]] can be set. For all available properties see below|empty| ​
 |colTotals|boolean|If set to true additional footer row is build. All pivot fields are summarized. Note that only summary function is aplied.|false| |colTotals|boolean|If set to true additional footer row is build. All pivot fields are summarized. Note that only summary function is aplied.|false|
 |frozenStaticCols|boolean|If set to true all fields defined in xDimension (see below) are set as frozen so that when scroll horizontally theses fields are always visible.|false| |frozenStaticCols|boolean|If set to true all fields defined in xDimension (see below) are set as frozen so that when scroll horizontally theses fields are always visible.|false|
Line 55: Line 55:
 |rowTotals|boolean|If set to true additional column is build ed which summarizes all column values of the row.|false| |rowTotals|boolean|If set to true additional column is build ed which summarizes all column values of the row.|false|
 |rowTotalsText|string|Set the column label of the column if rowTotals is set to true|Total| |rowTotalsText|string|Set the column label of the column if rowTotals is set to true|Total|
-|xDimension| array of objects| Defines the xDimension used by the grid. These values are the cells from source data that appear as rows in the grid. When more that one object element is set a grouping appear automatically. The hierarchy begin from the first object element. The last element is the last element in grouping. All properties of [[wiki:​colmodel_options | colModel]] can be set. See below for the remaining options. |empty| +|[[pivotsettings#​xDimension]]| array of objects| Defines the xDimension used by the grid. These values are the cells from source data that appear as rows in the grid. When more that one object element is set a grouping appear automatically. The hierarchy begin from the first object element. The last element is the last element in grouping. All properties of [[wiki:​colmodel_options | colModel]] can be set. See below for the remaining options. |empty| 
-|yDimension| array of objects| Defines the yDimension used by the grid. The values are build ed dynamically depend on the data. When more than one object element is set a header grouping appear automatically ​ The hierarchy begin from the first object element. The last element is the last element in header grouping. See below for the remaining options. |empty|+|[[pivotsettings#​yDimension]]| array of objects| Defines the yDimension used by the grid. The values are build ed dynamically depend on the data. When more than one object element is set a header grouping appear automatically ​ The hierarchy begin from the first object element. The last element is the last element in header grouping. See below for the remaining options. |empty|
 \\ \\
 \\ \\
Line 95: Line 95:
   * max - find the maximal value   * max - find the maximal value
  
 +The label property appear only if the length of the aggregates is greater than one. In this case we create additional group header which summarizes the aggregators. The label a taken from the data.
  
 +All properties of [[wiki:​colmodel_options | colModel]] can be set here.
 +
 +=== xDimension ===
 +As described [[ http://​en.wikipedia.org/​wiki/​Dimension_%28data_warehouse%29 |here]] //The dimension is a data set composed of individual, non-overlapping data elements. The primary functions of dimensions are threefold: to provide filtering, grouping and labeling. //
 +\\
 +Example:
 +\\
 +
 +<code javascript>​
 +xDimension : [
 + {
 +         dataName: '​CategoryName', ​
 + label: '​Category',​
 + width: 70
 + } , {
 + dataName: '​ProductName', ​
 + label: '​Product',​
 + frozen: false
 + }
 +]
 +</​code>​
 +
 +
 +**dataName** is a cell from data that appear as cell in the row. The value of this should correspond to a name in the data source. ​
 +\\
 +All properties of [[wiki:​colmodel_options | colModel]] can be set here.
 +\\
 +
 +If the pivot options **frozenStaticCols** is set to true the forozen property is set automatically. You can overwrite this by set a frozen:​false in the object, but be a carefully ​ with the order.
 +\\
 +
 +=== yDimension ===
 +The values build dynamically columns depend on the data source.\\
 +Example: ​
 +\\
 +<code javascript>​
 +yDimension : [
 + {
 + dataName: '​Country',​
 + converter:​ function(Value,​ xValues) {
 + return 'Total Countryies';​
 + }
 + },{
 + dataName: '​Country'​
 + }
 +]
 +</​code>​
 +
 +Possible options are:\\
 +**dataName** is a cell from data which build the column. The value of this should correspond to a name in the data source
 +\\
 +**converter** is function which can convert the source cell data and return new value. The parameters passed to this functions are:\\
 +  * Value - the value
 +  * xValues - the "​static"​ data from the row
 +
 +==== gridoptions ====
 +
 +These options are [[ options | options of the grid]]. You can set any of them.
 +
 +==== 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)