start dropdown grid column

This commit is contained in:
2023-04-03 17:32:07 +08:00
parent 6234154f33
commit cb3b03f365
4 changed files with 86 additions and 19 deletions

View File

@@ -18,21 +18,31 @@
grid.columns = [
{ key: 'c1', caption: 'column 1' },
{ key: 'c2', caption: 'column 2', allcheck: true, type: Grid.ColumnTypes.Checkbox, enabled: 'enabled' },
{
key: 'c2a',
caption: 'column 2 a',
type: Grid.ColumnTypes.Dropdown,
source: [
{ value: 'off', text: 'Off' },
{ value: 'pending', text: 'Pending' },
{ value: 'broken', text: 'Broken' },
{ value: 'running', text: 'Running' }
],
enabled: 'enabled'
},
{ key: 'c3', caption: 'column 3', width: 90 },
{ key: 'c4', caption: 'Note', type: Grid.ColumnTypes.Input }
];
grid.cellClicked = (rId, cId) => console.log(`row (${rId}), column (${cId}) clicked.`);
grid.init();
const source = [];
for (let i = 0; i < 1000; i++) {
source.push(
{ c1: 'abc', c2: true, c3: 12345, c4: 'Note note this is note', enabled: false },
{ c1: 'abc2bbbbaaaaa', c2: false, c3: 1225, c4: 'Note note this is note' },
{ c1: 'type', c2: false, c3: 121111 },
{ c1: 'diff', c2: true, c3: 124445555555555555 }
);
}
grid.source = source;
grid.source = [
{ c1: 'abc', c2: true, c2a: 'off', c3: 12345, c4: 'another note', enabled: false },
{ c1: 'abc2bbbbaaaaa', c2: false, c2a: 'pending', c3: 1225, c4: 'Note note this is note' },
{ c1: 'type', c2: false, c2a: 'broken', c3: 121111 },
{ c1: 'diff', c2: true, c2a: 'running', c3: 124445555555555555 },
{ c1: 'diff', c2: true, c2a: 'running', c3: 12499 },
{ c1: 'diff', c2: true, c2a: 'off', c3: 1244445 }
];
window.grid = grid;
}();