[code="java"]
var picPs = new Ext.data.JsonStore({
url: "getPic.action"+"?programInstanceId="+ node.id,
root: 'images',
fields: ['name', 'url','state', {name:'size', type: 'float'}]
});
picPs.load();
var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="thumb-wrap" id="{url}">',
'<div class="thumb"><a href="{url}" target="_blank" class="photo"><img src="{url}" title="{name}"></a></div>',
'<tpl if="this.isTrue(state)==true">',
'<span >停止 <a href="{url}">取消</a></span></div>',
'</tpl>',
'<tpl if="this.isTrue(state)==false">',
'<span><a href="baidu.com" target="_blank">开始</a> <a href="http://www.baidu.com" target="_blank">删除</a></span></div>',
'</tpl>',
'</tpl>',
{
isTrue: function(state){
return state == true;
}}
);
var picPanel = new Ext.Panel({
id:'images-view',
frame:true,
width:410,
height:270,
collapsible:true,
layout:'fit',
title:'图片',
tbar : [{
text : '上传',
iconCls : 'db-icn-upload',
handler : function() {
var dialog = new Ext.Window({
title : '多文件上传',
name:'dialog',
width : 500,
height : 500,
itemId:node.id,
resizable : false,
layout : 'fit',
items : [{
xtype : 'uploadpanel',
uploadUrl : 'uploadFiles.action',
filePostName : 'myUpload',
flashUrl : 'ExtJs/swfupload/swfupload.swf',
fileSize : '500 MB',
height : 400,
border : false,
fileTypes : '*.*',
fileTypesDescription : '图片或XML文件',
postParams : {
path : node.text + '\\',
programInstanceId:node.id
}
}],
listeners : {
"close" : function() {
this.tpl=tpl2;
picPs.reload();
picPanel.view.refresh();
//Ext.get(node.id+pic).tpl=tpl2;
}
},
bbar : ['fm1039.com']
});
dialog.show();
},
scope : this
}],
items: new Ext.DataView({
store: picPs,
tpl: tpl,
height:270,
id:node.id+'pic',
multiSelect: true,
overClass:'x-view-over',
itemSelector:'div.thumb-wrap',
emptyText: 'No images to display',
listeners: {
dblclick:{
fn:function(dv,nodes){
var cn = dv.getSelectedNodes()[0];
var showPic = new Ext.Window({
layout: 'fit',
title:'图片',
width:240,
height:320,
//autoHight:false,
modal:true,
html:"<img src='"+cn.id+"'>",
closeAction:'hide'
});
showPic.show();
}
}
}
})
});
[/code]
是不是那个tpl有问题?
显示没问题。。就是点击链接没反应