更新时间:2023-11-26 10:49:10
Thanks to those who pointed me to the right place in the doc, I finally found it!
I managed to achieve what you want by using the tpl
, unfortunately I could not find a way to make the keyboard navigation work for the added item. I've looked at the code of Ext.view.BoundListKeyNav
, but didn't find any easy solution...
The key was to use tpl
instead of itemTpl
, and add the markup for the extra item before the for
loop:
listConfig: {
tpl: '<div class="my-boundlist-item-menu">Add New Address</div>'
+ '<tpl for=".">'
+ '<div class="x-boundlist-item">' + itemTpl + '</div></tpl>'
,listeners: {
el: {
delegate: '.my-boundlist-item-menu'
,click: function() {
alert('Go go go!');
}
}
}
}
The rest of the code in on jsFiddle.