【发布时间】:2011-08-14 12:32:41
【问题描述】:
我有一个带有嵌套列表的 Sencha Touch 应用程序。
nestedList 自动创建自己的工具栏。
我想在工具栏下方停靠一个面板,但在列表项上方。我只需要在列表的顶层使用它。我希望在选择第一片叶子后让它消失。
这听起来可行吗?正如您在我的代码中看到的那样,我只能将项目面板停靠在当前工具栏的顶部。
提前非常感谢。我非常感谢你们提出的任何建议。
- 艾尔.
以下是我目前所拥有的......
// Menu Pages var menu = new Ext.NestedList({ fullscreen: true, title: 'Menu', displayField: 'text', store: menu_store,
// ** This is the dockedItem I would like to insert between the toolbar and list-items
dockedItems: [ {
xtype : 'panel',
dock : 'top',
html : '<span>This is the logo panel</span>',
cls : 'front-logo-panel',
flex : 1
}],
// Add Panel for Leaf nodes
getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data,
parentData = parent.attributes.record.data,
detailCard = new Ext.Panel({
scroll: 'vertical',
cls: 'menu-item-panel',
styleHtmlContent : true,
tpl: menuTemplate,
// add button to Leaf Node
listeners: {
activate: function() {
Ext.getCmp('itemToolbar').setTitle('New Title Bar');
}
}
});
detailCard.update(itemData);
this.backButton.setText(parentData.text);
return detailCard;
},
// add template for all nodes
getItemTextTpl: function() {
var tplConstructor =
'<tpl if="newItem">' +
'<span class="list-new-item">New Item!</span>' +
'</tpl>'+
'{text}' +
'<tpl>'+
'<div class="metadata">' +
'{description:ellipsis(40)}' +
'</div>' +
'</tpl>';
return tplConstructor;
}
});
【问题讨论】:
-
您找到解决方案了吗?我有完全相同的要求。谢谢!
标签: javascript-framework sencha-touch extjs