1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    91
    Vote Rating
    0
    Answers
    6
    alex9311 is on a distinguished road

      0  

    Default Unanswered: grid with checkcolumn

    Unanswered: grid with checkcolumn


    Hey all,

    I'm trying to get a column of checkboxes in my grid, which read from a boolean value in the store. I've read over the documentation for checkcolumn (http://docs.sencha.com/ext-js/4-0/#!...ux.CheckColumn) which seems to be what I need but I havn't gotten it to work properly. I'm using MVC architecture.

    It works when I display the boolean store value in a regular column but crashes when I try to display the checkcolumn.

    My grid view has:
    Code:
    Ext.define('AM.view.user.List' , {
            extend: 'Ext.grid.Panel',
            alias: 'widget.userlist',
            store: 'Users',
            height: 'auto',
            width: 'auto',
            autoFill: 'true',
            layout: 'fit',
            autoScroll: 'true',
            initComponent: function() {
                    this.columns=[
                            {header: 'checktest', dataIndex: 'check', width: 40},
                            {header: 'First Name', dataIndex: 'FirstName', width: 75},
                            {header: 'Last Name', dataIndex: 'Last',  width: 75},
                            //{xtype: 'checkcolumn', dataIndex: 'check', text: 'test', width: 50}
                    ];
                    this.callParent(arguments);
            }
    });
    my model looks like:

    Code:
    Ext.define('AM.model.User', {
            extend: 'Ext.data.Model',
            fields: [
                    {name: 'FirstName',     type: 'string'},
                    {name: 'Last',          type: 'string'},
                    {name: 'check',         type: 'bool'}
                    ],
    });
    and my store looks like:

    Code:
    Ext.define('AM.store.Users', {
            extend: 'Ext.data.Store',
            model: 'AM.model.User',
            data: [
                    {FirstName: 'Alex', Last: 'Chandler', check: false}
                    {FirstName: 'Saul', Last: 'Griffin, check: true}
                    {FirstName: 'Rebecca', Last: 'Rose', check: false}
            ],
    });

    Thank you for any advice!

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    115
    Answers
    346
    vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold

      1  

    Default


    You should load Ext.ux.CheckColumn before using it by using requires config:
    Code:
    Ext.define('AM.view.user.List' , {
        extend: 'Ext.grid.Panel',
        alias: 'widget.userlist',
        requires: ['Ext.ux.CheckColumn'],
        ...
    You also need to set path for Ext.ux namespace with Ext.Loader. Something likes this:
    Code:
    Ext.Loader.setConfig({
        enabled: true, // enable dynamic loading of classes
        paths: {
            'Ext.ux': 'Path to Ext.ux folder',
            ...
        }
    });

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    91
    Vote Rating
    0
    Answers
    6
    alex9311 is on a distinguished road

      0  

    Default


    thanks for the quick reply.

    On the documentation it says "Note. As of ExtJS 3.3 this no longer has to be configured as a plugin of the GridPanel."
    Isn't what you're describing configuring it as a plugin?

  4. #4
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    115
    Answers
    346
    vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold

      0  

    Default


    In Ext 4, Ext.ux.CheckColumn is an extension that does not include with Ext framework.

Thread Participants: 1

Tags for this Thread