alex9311
18 Sep 2012, 2:43 PM
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/#!/api/Ext.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:
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:
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:
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!
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/#!/api/Ext.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:
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:
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:
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!