set_pivotgrid()

* Pivot grid is only available in commercial license 6.6+. 

  • Parameter(s):
    • $configuration: Pivot configuration array parameter. Please see pivot demo for more information.
  • Description:
    • Create pivot grid from an existing datagrid. It renders the regular datagrid first, and then pivots based on configuration settings. In essence, phpGrid creates pivot in the client side browser without requiring any server side resource.
  • Remark:
    • You will first see a loading icon while pivot is rendered before it is displayed. It’s by design.
  • Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$dg->set_pivotgrid(
        array
        (
            "footerTotals" => 1,
            "footerAggregator" => "sum",
            "totals" => 1,
            "totalHeader" => "Grand Total",
            "totalText" => "Grand {0} {1}",
            "xDimension" => array
        (
        array
        (
            "dataName" => "status",
            "label" => "status",
            "sortorder" => "desc"
        ),
        array
        (
            "dataName" => "ProductName",
            "label" => "Product Name",
            "footerText" => "Total:"
        )

    ),

    "yDimension" => array
        (
            array
            (
                "dataName" => "orderDate",
                "sorttype" => "date",
                "totalHeader" => "Total in {0}"
            )

        ),

    "aggregates" => array
        (
            array
            (
                "member" => "status",
                "aggregator" => "count",
                "summaryType" => "count",
                "label" => "{1}"
            )

        )
    )
);