3
テーブルベースのテンプレートを作成したので、グリッド感を得ることができます。私の質問は、テーブルの行をクリックすると、(tdの情報を使って)ポップアップする警告をどうやって得ることができるかです。Sencha Touchアクセステンプレートデータ
は、ここに私のgetUserList.jsはあなたが与えることができる任意のアドバイスを
Ext.regModel("User", {
fields: [
"id",
"name",
"username",
"password",
"email",
"phone"
]
});
var myStore = new Ext.data.Store({
model: 'User',
proxy: {
type: 'ajax',
url : '../sencha/php/getUserList.php',
reader: {
type: 'json',
root: 'results'
}
},
autoLoad: true
});
var tpl = new Ext.XTemplate(//'<h2>test information</h2>'
'<table id="userTable"',
'<tpl for=".">',
'<tr>',
'<td class="x-view-over">',
'<span class="thumb-wrap">{id}</span>',
'</td>',
'<td class="x-view-over">',
'<span class="thumb-wrap"><a onclick="alert(tpl.name)">{name}</a></span>',
'</td>',
'<td>',
'{username}',
'</td>',
'<td>',
'{password}',
'</td>',
'<td>',
'{email}',
'</td>',
'<td>',
'{phone}',
'</td>',
'</tr>',
'</tpl>',
'</table>',
'<div class="x-clear"></div>'
);
var panel = new Ext.extend(Ext.Panel,{
id:'images-view',
frame:true,
//width:535,
autoHeight:true,
collapsible:true,
title:'Simple DataView',
initComponent: function() {
panel.superclass.initComponent.call(this);
},
items: new Ext.DataView({
store: myStore,
tpl: tpl,
autoHeight:true,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector:'tr',
emptyText: 'No images to display'
})
});
Ext.reg('userPanel', panel);
おかげファイルです。