Question

First of all, I am using Extjs 4.1.

I have a grid with property grid and I want to add a column of checkbox into the grid. The property grid code is as follows:

    var grid = Ext.create('Ext.grid.property.Grid', {
        tbars:[],
        selModel: Ext.create('Ext.selection.CheckboxModel',{mode: 'MULTI'}),
        columnLines: true,
        renderTo: Ext.getBody(),

        source: {
            "grouping": false,
            "autoFitColumns": true,
            "productionQuality": false,
            "created": Ext.Date.parse('10/15/2006', 'm/d/Y'),

        }
    });

However the checkbox selection model does not show up in the grid.

anyone can point me to the correct direction or property grid does not work with checkbox ?

Was it helpful?

Solution

Although the selModel property is documented in Ext.grid.property.Grid, this is only because Ext.grid.property.Grid extends Ext.grid.Panel. The problem is that this type of grid only has a fixed selModel and namely of type cellmodel. You can see its behaviour by clicking on a property (the property editor gets the focus and e.g a date proeprty shows a date picker). The cellmodel selModel is hard coded in the source code in the initComponent() method, so if you want to change that, you should write your own subclass in which you overwrite that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top