【发布时间】:2013-12-13 12:21:00
【问题描述】:
我对煎茶很陌生。我的要求是在嵌套列表中添加一个 html 按钮,每个项目会将所选项目发布到 Web API。
{
xtype: 'nestedlist',
title: 'Jobs',
iconCls: 'star',
getItemTextTpl: function (node) {
return '<div style="float:left">{text}</div><div style="float:right">
'<input type="button" title="xyz" value="pqr" id="someID"/></div>';
},
store: {
type: 'tree',
fields: [
'text', 'id', 'name', 'title',
{ name: 'leaf', defaultValue: true }
],
root: {
leaf: false
},
proxy: {
type: 'rest',
url: 'http://localhost/AD/api/jobs/',
reader: {
type: 'json',
// rootProperty: 'root'
}
}
},
detailCard: {
xtype: 'panel',
scrollable: true,
styleHtmlContent: true
},
listeners: {
itemtap: function (nestedList, list, index, element, post) {
debugger;
this.getDetailCard().setHtml('<pre><h4>Log</h4>' + post.get('AuditLog') + '</pre>');
},
}
我想将事件侦听器附加到按钮“SomeID”,以便将项目发布到 Web api 以进行进一步处理,然后在处理完成后刷新嵌套列表。
提前致谢
【问题讨论】:
标签: sencha-touch