[ExtJS5 Study Notes] section 23rd setting the column format of table gridpanel in Extjs5
Certificate ------------------------------------------------------------------------------------------------------------------------------------
When using tables, we load some text by default, but occasionally we have personalized requirements, such as I want to add a selection box or I need a date input. At this time, you need to configure the format attribute of gridpanel.
This error occurs during configuration: TypeError: headers [I]. getCellWidth is not a function
The configuration code is as follows:
Ext. create ('ext. grid. panel ', {frame: true, columnLines: true, // Add the table line selType: 'cellmodel', dockedItems: [{xtype: 'toolbar', dock: 'top ', items: [{xtype: 'label', text: 'Use Date: ', // glyph: 0xf016, // handler: 'bucket',}, {xtype: 'datefield ', name: 'dateuse', format: 'Y-m-d', submitFormat: 'Y-m-d'}, {text: 'view this segment ', listeners: {click: function () {alert ('I was clicked! ') ;},}]}], RenderTo: Ext. getBody (), columns: [{text: 'Vehicle ', dataIndex: 'Vehicle'}, {text: 'select', dataIndex: 'select', xtype: 'checkbox'}, // select the box {text: 'monday', dataIndex: 'monday'}, {text: 'tuesday', dataIndex: 'tuesday '}, {text: 'weday', dataIndex: 'weday'}, {text: 'thurs', dataIndex: 'thurs'}, {text: 'Friday', dataIndex: 'Friday'}, {text: 'saturday', dataIndex: 'saturday'}, {text: 'sunday', dataIndex: 'sunday'}], store: clxxStore }). show ();
When xtype is set to checkbox in the configuration selection box, an error occurs. The reason is that this attribute in gridpanel has a separate component Configuration:
Therefore, to configure check, you need to find this alias chekcolunm.
OK. The problem is solved in this way.