Skip to content

Commit 6b62886

Browse files
committed
examples.table.container.MainContainer: add table cell buttons as reference objects #6070
1 parent a444f20 commit 6b62886

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

examples/table/container/MainContainer.mjs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,31 +124,34 @@ class MainContainer extends ConfigurationViewport {
124124
{
125125
dataField: 'edit',
126126
text : 'Edit Action',
127-
renderer: ({ column, index }) => {
127+
renderer({column, index}) {
128128
const
129+
me = this,
129130
widgetId = `${column.id}-widget-${index}`,
130-
button = (column.widgetMap || (column.widgetMap = {}))[widgetId] || (column.widgetMap[widgetId] = Neo.create({
131+
button = (column.widgetMap || (column.widgetMap = {}))[widgetId] || (column.widgetMap[widgetId] = Neo.create({
131132
module : Button,
132-
appName : this.appName,
133-
handler : this.editButtonHandler,
133+
appName : me.appName,
134+
handler : 'up.editButtonHandler',
134135
parentId: 'myTableStoreContainer',
135136
text : 'Edit'
136137
}));
137138

138-
return button.vdom
139+
me.view.updateDepth = -1;
140+
141+
return button.createVdomReference()
139142
}
140-
},
141-
{
143+
}, {
142144
dataField: 'menu',
143145
text : 'Menu',
144-
renderer({ column, record, index }) {
146+
renderer({column, record, index}) {
145147
const
148+
me = this,
146149
widgetId = `${column.id}-widget-${index}`,
147-
button = (column.widgetMap || (column.widgetMap = {}))[widgetId] || (column.widgetMap[widgetId] = Neo.create('Neo.button.Base', {
150+
button = (column.widgetMap || (column.widgetMap = {}))[widgetId] || (column.widgetMap[widgetId] = Neo.create('Neo.button.Base', {
148151
ntype : 'button',
149-
appName : this.appName,
152+
appName : me.appName,
150153
text : '\u22ee',
151-
windowId: this.windowId,
154+
windowId: me.windowId,
152155
menu : {
153156
items : [{
154157
text : 'Menu option 1'
@@ -162,7 +165,9 @@ class MainContainer extends ConfigurationViewport {
162165
}
163166
}));
164167

165-
return button.vdom
168+
me.view.updateDepth = -1;
169+
170+
return button.createVdomReference()
166171
}
167172
}
168173
]

0 commit comments

Comments
 (0)