From 88e159f864cfc6afdaddef3b7d1bd3be98360083 Mon Sep 17 00:00:00 2001 From: Marko Stijak Date: Thu, 9 Apr 2020 10:57:26 +0200 Subject: [PATCH] CSS based row numbering --- docs/content/examples/grid/Buffering.js | 12 ++++++------ packages/cx/src/widgets/grid/Grid.js | 2 +- packages/cx/src/widgets/grid/Grid.scss | 15 ++++++++++----- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/content/examples/grid/Buffering.js b/docs/content/examples/grid/Buffering.js index 4d796e9ae..517ead0c2 100644 --- a/docs/content/examples/grid/Buffering.js +++ b/docs/content/examples/grid/Buffering.js @@ -38,11 +38,11 @@ export const Buffering = records:bind="$page.records" keyField="id" buffered - style="height: 800px" + style="height: 650px" mod="fixed-layout" cached columns={[ - { header: '#', field: "index", sortable: true, value: { expr: "{$index}+1"}, defaultWidth: 50 }, + { header: '#', defaultWidth: 50, items:
}, { header: { text: "Name", style: 'width: 100%' }, field: "fullName", sortable: true, resizable: true }, { header: "Continent", field: "continent", sortable: true, resizable: true, defaultWidth: 150 }, { header: "Browser", field: "browser", sortable: true, resizable: true, defaultWidth: 170 }, @@ -75,20 +75,20 @@ export const Buffering = records:bind="$page.records" keyField="id" buffered - style="height: 800px" + style="height: 650px" mod="fixed-layout" cached columns={[ - { header: '#', field: "index", sortable: true, value: { expr: "{$index}+1"} }, + { header: '#', defaultWidth: 50, items:
}, { header: { text: "Name", style: 'width: 100%' }, field: "fullName", sortable: true, resizable: true }, { header: "Continent", field: "continent", sortable: true, resizable: true, defaultWidth: 150 }, { header: "Browser", field: "browser", sortable: true, resizable: true, defaultWidth: 170 }, - { header: "OS", field: "os", sortable: true, resizable: true, defaultWidth: 100 }, + { header: "OS", field: "os", sortable: true, resizable: true, defaultWidth: 80 }, { header: "Visits", field: "visits", sortable: true, align: "right", resizable: true, defaultWidth: 70 } ]} selection={{ type: KeySelection, bind: "$page.selection" }} /> - `} + `} diff --git a/packages/cx/src/widgets/grid/Grid.js b/packages/cx/src/widgets/grid/Grid.js index 70d8bf6b2..fc8de1194 100644 --- a/packages/cx/src/widgets/grid/Grid.js +++ b/packages/cx/src/widgets/grid/Grid.js @@ -1745,7 +1745,7 @@ class GridComponent extends VDOM.Component { return (