From a488cdab0fa13ebcf31cdd860526ab788af48d36 Mon Sep 17 00:00:00 2001 From: Asad Date: Thu, 26 Dec 2024 12:34:42 -0500 Subject: [PATCH] chore: openui5 row-cols removed --- docz/docs/03-demos/02-frontend/10-openui5.md | 29 -------------------- 1 file changed, 29 deletions(-) diff --git a/docz/docs/03-demos/02-frontend/10-openui5.md b/docz/docs/03-demos/02-frontend/10-openui5.md index 322687c..c1a8355 100644 --- a/docz/docs/03-demos/02-frontend/10-openui5.md +++ b/docz/docs/03-demos/02-frontend/10-openui5.md @@ -512,35 +512,6 @@ will generate a workbook that can be opened in a spreadsheet editor. -### Rows and Columns - -Some data grids and UI components split worksheet state in two parts: an array -of column attribute objects and an array of row objects. The former is used to -generate column headings and for indexing into the row objects. - -The safest approach is to use an array of arrays for state and to generate -column objects that map to A1-Style column headers. - -The [React Data Grid demo](/docs/demos/grid/rdg#rows-and-columns-state) uses -this approach with the following column and row structure: - -```js -/* rows are generated with a simple array of arrays */ -const rows = utils.sheet_to_json(worksheet, { header: 1 }); - -/* column objects are generated based on the worksheet range */ -const range = utils.decode_range(ws["!ref"]||"A1"); -const columns = Array.from({ length: range.e.c + 1 }, (_, i) => ({ - /* for an array of arrays, the keys are "0", "1", "2", ... */ - key: String(i), - /* column labels: encode_col translates 0 -> "A", 1 -> "B", 2 -> "C", ... */ - name: XLSX.utils.encode_col(i) -})); -``` - -![Column labels for headers](pathname:///react/cols.png) - - [^1]: See [`JSONModel`](https://sdk.openui5.org/1.38.62/docs/api/symbols/sap.ui.model.json.JSONModel.html) in the OpenUI5 documentation. [^2]: See OpenUI5's [MVC Documentation](https://sdk.openui5.org/topic/91f233476f4d1014b6dd926db0e91070) for detailed explanation of the pattern implementation.