Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.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
Javascript ExtJS按钮不执行处理程序_Javascript_Extjs - Fatal编程技术网

Javascript ExtJS按钮不执行处理程序

Javascript ExtJS按钮不执行处理程序,javascript,extjs,Javascript,Extjs,我正在创建下面的表单,但由于某些原因,选择按钮处理程序没有创建 被处决。其他一切都正常工作(将数据加载到网格中)。 有什么我遗漏的吗 Ext.Loader.setConfig({enabled:true}); Ext.define('Project', { extend: 'Ext.data.Model', fields: ['PID', 'ProjectName'] }); var projectsStore = Ext.create('Ext.data.Store',

我正在创建下面的表单,但由于某些原因,选择按钮处理程序没有创建 被处决。其他一切都正常工作(将数据加载到网格中)。 有什么我遗漏的吗

Ext.Loader.setConfig({enabled:true});

Ext.define('Project', {
    extend: 'Ext.data.Model',
    fields: ['PID', 'ProjectName']
});

var projectsStore = Ext.create('Ext.data.Store', 
{
    model: 'Project',
    autoLoad: true,
    proxy:{
        type: 'ajax',
        url : 'projects.php?action=read',
        reader:{ type:'json', root:'projects', successProperty:'success' } }
});

Ext.onReady(
    function()
    {   
        var simple = Ext.create('Ext.form.Panel', {
        url:'projects.php?action=select',
        frame:true,
        title: 'Projects',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        fieldDefaults: {
            msgTarget: 'side',
            labelWidth: 75
        },
        defaultType: 'textfield',
        defaults: {
            anchor: '100%'
        },

        items: [{
            columnWidth: 0.60,
        xtype: 'gridpanel',
       store: projectsStore,
        height: 400,
        title:'General',
        columns: [
         {header: 'Id', dataIndex: 'PID', flex: 1},
         {header: 'Project Name',  dataIndex: 'ProjectName',  flex: 1},
       ]
        }],

        buttons: [{
            text: 'Select',
            handler: function() {
                Ext.Msg.alert('Selecting', action.result.msg);              
            }
        }]
    });

    simple.render('proj-form');

        projectsStore.load();   
    }
);

您的代码在运行处理程序时正在崩溃,因为
action.result.msg
不存在

您可以查看Firebug/Chrome开发工具,它会向您显示问题所在