* @returns {Neo.table.Container}
()
| 111 | * @returns {Neo.table.Container} |
| 112 | */ |
| 113 | createExampleComponent() { |
| 114 | return Neo.create(TableContainer, { |
| 115 | id : 'myTableStoreContainer', |
| 116 | store: MainStore, |
| 117 | |
| 118 | bodyConfig: { |
| 119 | selectionModel: CellModel |
| 120 | }, |
| 121 | |
| 122 | columns: [ |
| 123 | {dataField: 'firstname', text: 'Firstname'}, |
| 124 | {dataField: 'lastname', text: 'Lastname'}, |
| 125 | {dataField: 'githubId', text: 'Github Id'}, |
| 126 | {dataField: 'country', text: 'Country'}, |
| 127 | { |
| 128 | dataField: 'edit', |
| 129 | text : 'Edit Action', |
| 130 | renderer({column, rowIndex}) { |
| 131 | const |
| 132 | me = this, |
| 133 | widgetId = `${column.id}-widget-${rowIndex}`, |
| 134 | button = (column.widgetMap || (column.widgetMap = {}))[widgetId] || (column.widgetMap[widgetId] = Neo.create({ |
| 135 | module : Button, |
| 136 | appName : me.appName, |
| 137 | handler : 'up.editButtonHandler', |
| 138 | parentId: 'myTableStoreContainer', |
| 139 | text : 'Edit' |
| 140 | })); |
| 141 | |
| 142 | me.body.updateDepth = -1; |
| 143 | |
| 144 | return button.createVdomReference() |
| 145 | } |
| 146 | }, { |
| 147 | dataField: 'menu', |
| 148 | text : 'Menu', |
| 149 | renderer({column, record, rowIndex}) { |
| 150 | const |
| 151 | me = this, |
| 152 | widgetId = `${column.id}-widget-${rowIndex}`, |
| 153 | button = (column.widgetMap || (column.widgetMap = {}))[widgetId] || (column.widgetMap[widgetId] = Neo.create('Neo.button.Base', { |
| 154 | ntype : 'button', |
| 155 | appName : me.appName, |
| 156 | text : '\u22ee', |
| 157 | windowId: me.windowId, |
| 158 | menu : { |
| 159 | items : [{ |
| 160 | text : 'Menu option 1' |
| 161 | }, { |
| 162 | text : 'Menu option 2' |
| 163 | }, { |
| 164 | text : 'Menu option 3' |
| 165 | }, { |
| 166 | text : 'Menu option 4' |
| 167 | }] |
| 168 | } |
| 169 | })); |
| 170 |