File tree Expand file tree Collapse file tree 2 files changed +52
-4
lines changed
Expand file tree Collapse file tree 2 files changed +52
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,31 @@ This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) pac
1919@example :
2020const grid = new dhx.Grid("grid_container", {
2121 columns: [
22- // columns config
22+ {
23+ id: "productId",
24+ header: [ { text: "Product Id" }] ,
25+ summary: "count",
26+ footer: [ { text: summary => ` Total: ${summary.count} ` }] ,
27+ },
28+ {
29+ id: "category",
30+ header: [ { text: "Category" }] ,
31+ },
32+ {
33+ id: "price",
34+ type: "number",
35+ numberMask: { prefix: "$" },
36+ header: [ { text: "Price" }] ,
37+ summary: "avg",
38+ footer: [ { text: summary => ` Avg: ${summary.avg} ` }] ,
39+ },
40+ {
41+ id: "stock",
42+ type: "number",
43+ header: [ { text: "Stock" }] ,
44+ summary: "sum",
45+ footer: [ { text: summary => ` Total: ${summary.sum} ` }] ,
46+ },
2347 ] ,
2448 data: dataset,
2549 footerPosition: "bottom", // "relative" by default
Original file line number Diff line number Diff line change @@ -1616,16 +1616,40 @@ You can define the logic of setting the position of the Grid footer as well as o
16161616
16171617
16181618
1619- Here is the example of positioning the footer and two frozen rows at the bottom of the Grid, as presented in the above image:
1619+ Here is the example of positioning the footer and a frozen row at the bottom of the Grid, as presented in the above image:
16201620
16211621~~~jsx
16221622const grid = new dhx.Grid("grid_container", {
16231623 columns: [
1624- // columns config
1624+ {
1625+ id: "productId",
1626+ header: [{ text: "Product Id" }],
1627+ summary: "count",
1628+ footer: [{ text: summary => `Total: ${summary.count}` }],
1629+ },
1630+ {
1631+ id: "category",
1632+ header: [{ text: "Category" }],
1633+ },
1634+ {
1635+ id: "price",
1636+ type: "number",
1637+ numberMask: { prefix: "$" },
1638+ header: [{ text: "Price" }],
1639+ summary: "avg",
1640+ footer: [{ text: summary => `Avg: ${summary.avg}` }],
1641+ },
1642+ {
1643+ id: "stock",
1644+ type: "number",
1645+ header: [{ text: "Stock" }],
1646+ summary: "sum",
1647+ footer: [{ text: summary => `Total: ${summary.sum}` }],
1648+ },
16251649 ],
16261650 data: dataset,
16271651 footerPosition: "bottom", // "relative" by default
1628- bottomSplit: 2
1652+ bottomSplit: 1
16291653});
16301654~~~
16311655
You can’t perform that action at this time.
0 commit comments