Ext grid Add line serial number, check box __ext

Source: Internet
Author: User

Adding columns to a table is implemented in the colunms of the definition of the grid:

1. Line serial number

{header: ' Serial number ', Xtype: ' Rownumberer ', width:60, align: ' center ', sortable:false}

If you want to do the table additions and deletions, and refresh the number of columns:

Adding no tube, the table sequence will automatically achieve the self increase;

If you delete, you need to invoke the Refresh view implementation:

Ext.each (Reconrds, function (record) {
    EXT.GETCMP (' Potenshow '). Store.remove (record);
})
EXT.GETCMP (' Potenshow '). GetView (). Refresh (); After a row of records is deleted, the row sequence number is reordered;


2. check box

SelModel:Ext.create (' Ext.selection.CheckboxModel ', {}),

3. Extended Column

The extended column is not displayed at all times, but preceded by a "+" number in front of each line, when clicked on the plus sign expands, it is appropriate to display a larger number of columns in a table or a column with more and less important displays:

This can also be defined as a plug-in for a table:

Plugins: [
                {
                    ptype: ' Rowexpander ',
                    rowbodytpl:new ext.xtemplate (
                    "<p style= ' position:ralative; Top:10px;font-size:12px;color: #ff0000; ' > Founder </p> ",
                    ' <p>{CREATE_USER}</p> ',
                    " <p style= ' position:ralative;top:10px; Font-size:12px;color: #ff0000; ' > Creation Time </p> ",
                    ' <p>{CREATE_TIME}</p> ',
                    " <p style= ' position:ralative;top:10px; Font-size:12px;color: #ff0000; ' > Remarks </p> ",
                    ' <p>{REMARK}</p> '
                    )
                }
            ]
Here the variable in brace {} is the field name in the gird data;

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.