0.4.9 • Published 5 years ago

rollun-ts-grid v0.4.9

Weekly downloads
154
License
-
Repository
-
Last release
5 years ago

rollun-ts-grid

Brand new rollun grid made using Dojo.

Installation

preferred way to install this library is via npm. Run

npm install rollun-ts-grid

or add

"rollun-ts-grid": "*",

to the dependencies section of your package.json

Usage

Basic usage

import renderer from '@dojo/framework/widget-core/vdom';
import { w } from '@dojo/framework/widget-core/d';
import { Registry } from '@dojo/framework/widget-core/Registry';
import GridContext from 'rollun-ts-grid/dist/all/context/GridContext';
import Grid from 'rollun-ts-grid/dist/all/gridWidgets/grid';
import { RowRows, RowFields } from 'rollun-ts-grid/dist/all/common/interfaces';

const rowRows: RowRows = {
	rows: [
		{
			id: 0,
			cells: [
				{value: '1'},
				{value: '2'},
				{value: '3'},
				{value: '4'},
			]
		},
		{
			id: 1,
			cells: [
				{value: '1'},
				{value: '2'},
				{value: '3'},
				{value: '4'},
			]
		},
		{
			id: 2,
			cells: [
				{value: '1'},
				{value: '2'},
				{value: '3'},
				{value: '4'},
			]
		},
		{
			id: 3,
			cells: [
				{value: '1'},
				{value: '2'},
				{value: '3'},
				{value: '4'},
			]
		},
		{
			id: 4,
			cells: [
				{value: '1'},
				{value: '2'},
				{value: '3'},
				{value: '4'},
			]
		},
	]
};
const rowFields: RowFields = {
	fieldsInfo: [
		{name: 'A'},
		{name: 'B'},
		{name: 'C'},
		{name: 'D'},
	]
};
let gridContext: GridContext;
const registry = new Registry();
registry.defineInjector('gridContext',
	(invalidator: () => void) => {
		gridContext = new GridContext(invalidator, {
			rows: rowRows,
			fields: rowFields
		});
		return () => gridContext;
	}
);
const r = renderer(() => w(Grid, {context: gridContext}));
r.mount({
	registry
});

Code above renders a 4x4 grid

Render QueryApp

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.2.14

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago