[ExtJS5 Study Notes] section 23rd setting the column format of table gridpanel in Extjs5

Source: Internet
Author: User

[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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.