1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    15
    Vote Rating
    0
    bill_chuang is on a distinguished road

      0  

    Default Answered: How to add a checkbox column in a gridpanel in ExtJS4.0.2

    Answered: How to add a checkbox column in a gridpanel in ExtJS4.0.2


    Now I want to add a checkbox column in a gridpanel like this.未命名.jpg
    Andbody help me?

  2. There is an example here on this page:
    http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/grid-plugins.html

    *
    extract
    Code:
    var sm = Ext.create('Ext.selection.CheckboxModel');    var grid2 = Ext.create('Ext.grid.Panel', {        store: getLocalStore(),        selModel: sm,        columns: [            {text: "Company", width: 200, dataIndex: 'company'},            {text: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'},            {text: "Change", dataIndex: 'change'},            {text: "% Change", dataIndex: 'pctChange'},            {text: "Last Updated", width: 135, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}        ],        columnLines: true,        width: 600,        height: 300,        frame: true,        title: 'Framed with Checkbox Selection and Horizontal Scrolling',        iconCls: 'icon-grid',        renderTo: Ext.getBody()    });

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,993
    Vote Rating
    212
    Answers
    476
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    There is an example here on this page:
    http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/grid-plugins.html

    *
    extract
    Code:
    var sm = Ext.create('Ext.selection.CheckboxModel');    var grid2 = Ext.create('Ext.grid.Panel', {        store: getLocalStore(),        selModel: sm,        columns: [            {text: "Company", width: 200, dataIndex: 'company'},            {text: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'},            {text: "Change", dataIndex: 'change'},            {text: "% Change", dataIndex: 'pctChange'},            {text: "Last Updated", width: 135, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}        ],        columnLines: true,        width: 600,        height: 300,        frame: true,        title: 'Framed with Checkbox Selection and Horizontal Scrolling',        iconCls: 'icon-grid',        renderTo: Ext.getBody()    });

  4. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    15
    Vote Rating
    0
    bill_chuang is on a distinguished road

      0  

    Default


    Quote Originally Posted by slemmon View Post
    There is an example here on this page:
    http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/grid-plugins.html

    *
    extract
    Code:
    var sm = Ext.create('Ext.selection.CheckboxModel');    var grid2 = Ext.create('Ext.grid.Panel', {        store: getLocalStore(),        selModel: sm,        columns: [            {text: "Company", width: 200, dataIndex: 'company'},            {text: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'},            {text: "Change", dataIndex: 'change'},            {text: "% Change", dataIndex: 'pctChange'},            {text: "Last Updated", width: 135, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}        ],        columnLines: true,        width: 600,        height: 300,        frame: true,        title: 'Framed with Checkbox Selection and Horizontal Scrolling',        iconCls: 'icon-grid',        renderTo: Ext.getBody()    });
    Thanks.It's helpful

Thread Participants: 1

Tags for this Thread