show different item on selectionchange on a grid

前端 未结 2 1915
夕颜
夕颜 2020-12-21 16:44

i have a grid and a form, i need to show different items on the form each time we select a row on that grid

i ve been looking on how to do this, and found

2条回答
  •  -上瘾入骨i
    2020-12-21 17:24

    You get the selected rows as second parameter in the selectionchange event handler:

    listeners: {
        selectionchange: function (view, selections, options) {
            console.log(view, selections, options);
        }
    }
    

    So the first selected row is the first element in the selections array:

    record = selections[0]
    

    This is described in the Ext JS 4 API documentation for the selectionchange event.

提交回复
热议问题