Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:pivotexample [2014/02/17 15:30] tony |
wiki:pivotexample [2017/12/12 17:25] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Pivot Example ====== | ====== Pivot Example ====== | ||
With this example we will try to explain and build pivot grid. We hope it will be clear, so that more user can have idea what is happen. | With this example we will try to explain and build pivot grid. We hope it will be clear, so that more user can have idea what is happen. | ||
- | Now - lets do first with the data. | + | Now - lets do first with the data. |
===== Data ===== | ===== Data ===== | ||
Line 126: | Line 126: | ||
aggregator : 'sum', | aggregator : 'sum', | ||
width:50, | width:50, | ||
- | label:'Sum Price' | + | label:'Sum' |
}, { | }, { | ||
member : 'Quantity', | member : 'Quantity', | ||
aggregator : 'sum', | aggregator : 'sum', | ||
width:50, | width:50, | ||
- | label:'Sum Qty' | + | label:'Qty' |
} | } | ||
] | ] | ||
Line 142: | Line 142: | ||
The final code with jqGrid setting is: | The final code with jqGrid setting is: | ||
- | <code> | + | <code javascript> |
<script type="text/javascript"> | <script type="text/javascript"> | ||
jQuery(document).ready(function(){ | jQuery(document).ready(function(){ | ||
Line 158: | Line 158: | ||
], | ], | ||
aggregates : [ | aggregates : [ | ||
- | {member : 'Price', aggregator : 'sum', width:50, label:'Sum Price'}, | + | {member : 'Price', aggregator : 'sum', width:50, label:'Sum'}, |
- | {member : 'Quantity', aggregator : 'sum', width:50, label:'Sum Qty'} | + | {member : 'Quantity', aggregator : 'sum', width:50, label:'Qty'} |
], | ], | ||
rowTotals: true | rowTotals: true | ||
Line 170: | Line 170: | ||
rowNum : 10, | rowNum : 10, | ||
pager: "#pager", | pager: "#pager", | ||
- | caption: "Pivot Grid" | + | caption: "Amounts and quantity by category and product" |
}); | }); | ||
}); | }); | ||
Line 183: | Line 183: | ||
</html> | </html> | ||
</code> | </code> | ||
+ | |||
+ | The final result can look like this | ||
+ | |||
+ | {{:wiki:amtbycatprod.png|}} | ||