0

I have started to use ExtJs 4. I have grid with buttons in one column. I can't manage to get button click for button in selected cell by controller. I would like to get click and then details for row in order to open extra window with details.

Code:

Ext.define('AP.controller.List', {
    extend : 'Ext.app.Controller',
    stores : ['Users'],
    models : ['User'],
    views : [ 'List', 'Details' ],

    init : function() {
        console.log("users");
        this.control({
            'viewport > listPanel > userlist' : { 
                itemdblclick : this.userDbCClicked
            },
            'viewport > listPanel button AND WHAT MORE ?' : {
                click : this.statusButtonClicked
            }       
        });
    },

    userDbCClicked : function(grid, record) {
        console.log("user db clicked");

    },


    statusButtonClicked : function(grid, record) {
          // Here I would like to get row details after click on button in column
        console.log("statusButtonClicked clicked ");
    }

});

What should be put instead this code:

        'viewport > listPanel button AND WHAT MORE?' : {
            click : this.statusButtonClicked
        }

Of course it dosen't work. How to get row by click on button in cell ?

Thanks in advance for help.

ExtJs is very powerfull framework but first steps are realy difficulted sometimes.

Bogus

4

2 に答える 2

0

クリスの言うことは本当です。ボタンの名前プロパティを使用することもできます。これは、コンポーネントをクエリする方法にすぎません。ここで説明:

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.ComponentQuery

{xtype:'ボタン'、名前:'statusbutton'}

'ビューポート>listPanel>ボタン[名前=ステータスボタン]'

Ext.Appsの開始ガイドは次のとおりです。

http://docs.sencha.com/ext-js/4-1/#!/guide/mvc_pt1ともう 1つ: http: //docs.sencha.com/ext-js/4-1/#! / guide / application_architecture

于 2012-08-02T15:00:33.330 に答える
0

アクションを配置します:ボタン設定に「statusbutton」

次に、'viewport> listPanel> button [action=statusbutton]'を使用します

于 2012-08-02T13:49:10.457 に答える