在ExtJs4里,显示数据列表一般可以使用panel解决,在这次项目中偶然遇到需要显示图片列表的需求。在查阅了百度和官方API后终于解决了这个问题。在图片展示里一边的主要有下面2种展示模式(代码模式为MVC的结构)。
一、列表展示
直接贴代码:
view层:
xtype: 'gridpanel',
height: 217,
store:'PattachmentStoDBTP',
id:'pattstoidtp',
name:'dbimgs',
// title : '图片列表',
columns: [
{
hidden:true,
dataIndex : 'pattachmentid',
text : '宣传图序号'
},{
dataIndex : 'pattachmentimgpath',
align:'center',
text : '宣传图缩略图',
renderer:function(value)//renderer很有用
{
//这里为缩略图的图片地址
return '<img width="80" height="50" src="'+getRootPath()+'