Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs将复选框添加到container.viewport_Extjs_Checkbox - Fatal编程技术网

Extjs将复选框添加到container.viewport

Extjs将复选框添加到container.viewport,extjs,checkbox,Extjs,Checkbox,我是extjs新手,正在尝试向container.viewport gridpanel添加一个复选框 这是我的代码: xtype: 'gridpanel', flex: 2, autoScroll: true,

我是extjs新手,正在尝试向container.viewport gridpanel添加一个复选框

这是我的代码:

                                        xtype: 'gridpanel',
                                        flex: 2,
                                        autoScroll: true,
                                        title: 'title',
                                        store: 'OutgoingDataStore',

                                        columns: [
                                            {
                                                xtype: 'gridcolumn',
                                                align: 'right',
                                                dataIndex: 'calls_m',
                                                text: 'Calls Monthly'
                                            },
                                            {
                                                xtype: 'checkcolumn',
                                                align: 'right',
                                                dataIndex: 'check',
                                                text: 'check',

                                            }..

如果没有CheckColumn,它可以正常工作,但是当我添加它时,应用程序会显示空页,并且在控制台上我看到:'UncaughtTypeError:Cannotcallmethod'substring'of undefined'

这取决于您使用的版本。在4.2.0中,CheckColumn被移动到核心库中。如果您使用的是早期版本(看起来是),那么CheckColumn只是一个扩展,因此您需要从examples/ux文件夹中包含它。

在4.2.0中,您可以这样做

    xtype: 'gridpanel',
    flex: 2,
    autoScroll: true,
    title: 'title',
    store: 'OutgoingDataStore',
    selModel: Ext.create('Ext.selection.CheckboxModel'), // This will add check column
    columns: [
       {
           xtype: 'gridcolumn',
           align: 'right',
           dataIndex: 'calls_m',
           text: 'Calls Monthly'
       }
     ...