[英]How to detect if item is selected in Google Maps API autocomplete list?
[英]List Component: How to detect which item was selected?
我可以在控制器中訪問列表(作為項的容器),但是我不知道如何訪問列表項的屬性。
如何創建正確的ComponentQuery規則? 我嘗試了“列表>項目”,但是它不起作用。
每個項目都有其標題,但在selectSection中輸出為“ undefined”。
Ext.define( 'UGP.controller.BeginList',
{
extend: 'Ext.app.Controller',
config:
{
views: [ 'BeginList' ],
control:
{
'list':
{
select: 'selectSection'
}
}
},
selectSection: function()
{
Ext.Msg.alert( 'title=' + this.title );
}
}
);
具有列表組件的BeginList.js:
Ext.define( 'UGP.view.BeginList',
{
extend: 'Ext.List',
config:
{
fullscreen: true,
itemTpl: '{title}',
data:
[
{ title: 'Chapter 1', id: 0, action: "selectSection" },
{ title: 'Chapter 2', id: 1, action: "selectSection" },
{ title: 'Chapter 3', id: 2, action: "selectSection" },
{ title: 'Chapter 4', id: 3, action: "selectSection" }
]
}
}
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.