Skip to content

Commit 76f2b98

Browse files
committed
examples.grid.bigData.MainContainer: add a header toolbar with controls #6212
1 parent aa46d7a commit 76f2b98

2 files changed

Lines changed: 70 additions & 5 deletions

File tree

examples/grid/bigData/MainContainer.mjs

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import ComboBox from '../../../src/form/field/ComboBox.mjs';
12
import GridContainer from './GridContainer.mjs';
3+
import Toolbar from '../../../src/toolbar/Base.mjs';
24
import Viewport from '../../../src/container/Viewport.mjs';
35

46
/**
@@ -13,18 +15,81 @@ class MainContainer extends Viewport {
1315
*/
1416
className: 'Neo.examples.grid.bigData.MainContainer',
1517
/**
16-
* @member {Object[]} items=[GridContainer]
18+
* @member {Object[]} items
1719
*/
18-
items: [GridContainer],
20+
items: [{
21+
module: Toolbar,
22+
flex : 'none',
23+
style : {marginBottom: '1em'},
24+
items : [{
25+
module : ComboBox,
26+
clearable : false,
27+
displayField: 'id',
28+
editable : false,
29+
labelText : 'Amount Rows',
30+
labelWidth : 110,
31+
listeners : {change: 'up.onAmountRowsChange'},
32+
store : ['1000', '5000', '10000', '20000'],
33+
value : '10000',
34+
width : 200
35+
}, {
36+
module : ComboBox,
37+
clearable : false,
38+
displayField: 'id',
39+
editable : false,
40+
labelText : 'Amount Columns',
41+
labelWidth : 135,
42+
listeners : {change: 'up.onAmountColumnsChange'},
43+
store : ['25', '50', '75', '100'],
44+
style : {marginLeft: '2em'},
45+
value : '50',
46+
width : 200
47+
}, {
48+
module : ComboBox,
49+
clearable : false,
50+
displayField: 'id',
51+
editable : false,
52+
labelText : 'Buffer Rows',
53+
labelWidth : 100,
54+
listeners : {change: 'up.onAmountBufferRowsChange'},
55+
store : ['0', '3', '5', '10', '25', '50'],
56+
style : {marginLeft: '2em'},
57+
value : '5',
58+
width : 160
59+
}]
60+
}, {
61+
module: GridContainer
62+
}],
1963
/**
20-
* @member {Object} layout={ntype:'fit'}
64+
* @member {Object} layout={ntype:'vbox',align:'stretch'}
2165
*/
22-
layout: {ntype: 'fit'},
66+
layout: {ntype: 'vbox', align: 'stretch'},
2367
/**
2468
* @member {Object} style={padding:'20px'}
2569
*/
2670
style: {padding: '20px'}
2771
}
72+
73+
/**
74+
* @param {Object} data
75+
*/
76+
onAmountBufferRowsChange(data) {
77+
console.log('onAmountBufferRowsChange', data);
78+
}
79+
80+
/**
81+
* @param {Object} data
82+
*/
83+
onAmountColumnsChange(data) {
84+
console.log('onAmountColumnsChange', data);
85+
}
86+
87+
/**
88+
* @param {Object} data
89+
*/
90+
onAmountRowsChange(data) {
91+
console.log('onAmountRowsChange', data);
92+
}
2893
}
2994

3095
export default Neo.setupClass(MainContainer);

examples/grid/bigData/MainStore.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MainStore extends Store {
1616
*/
1717
construct(config) {
1818
super.construct(config);
19-
this.data = this.generateData(50000);
19+
this.data = this.generateData(10000);
2020
console.log(this);
2121
}
2222

0 commit comments

Comments
 (0)