1

MVC デモ プロジェクト ガイドから始めて、追加のアクション列を追加しましたが、コントローラー ファイルでそれをどのように配線するのか疑問に思っていました。

ガイド: http://www.sencha.com/learn/the-mvc-application-architecture/

Ext.define('app.view.admin.viewlist', {
extend: 'Ext.grid.Panel',
columnLines: true,
region: 'center',
menuDisabled: true,
layout: 'fit',
initComponent: function (cnfg) {
    this.columns = [
        {
            text: 'date',
            dataIndex: 'Series',
            sortableColumns: false,
            hideable: false,
            enableLocking: false,
            width: 100
        },{
            hidden : true,
            text:'Values',
            sortableColumns : false,
            hideable: false,
            columns:[{
                header: 'D1',
                hidden: true,
                dataIndex: 'D10EOD',
                sortableColumns : false,
                hideable: false
            },{
                xtype: 'actioncolumn',
                icon: '/static/img/icon/table_refresh.png',
                tooltip: 'Reset',
                align: 'center'

        }]
        }
    ];
    this.callParent(arguments);

}});

コントローラー初期化関数

init: function() {
    this.control({
        'volatilityedit actioncolumn img' : {   <--- ??
            click: this.reset
        }
    });
},
reset: function(grid, rowIndex, colIndex) {
    //var rec = grid.getStore().getAt(rowIndex);
    alert("Go");
},

ありがとう

4

2 に答える 2