[ExtJs4.0]当鼠标停留在某行的时候显示此物品缩略图
2012-08-16 13:09
232 查看
控制器代码:
[ExtjsAction("view")]
public ActionResult GetById()
{
string picId = GetParameter("Id");
foreach (var image in picInfo.Images)
{
image.PicAddress = "http://localhost:8088/pic/Image/" + image.PicAddress;
}
return this.JsonFormat(new ExtjsFormInfo(picInfo));
}
js页面代码:
var panel = Ext.create('Ext.Panel', {
bodyStyle: 'padding-top:5px 5px 0;background-color:#DFE9F6',
layout: {
type: 'table',
columns: 3
},
frame: true,
name: 'picPanle',
id: 'images-view',
collapsible: true,
width: 120,
title: '图片信息',
items: Ext.create('Ext.view.View', {
store: {
model: 'OOO.model.picPackage.Picture',
proxy: {
type: 'memory',
reader: {
type: 'json'
}
}
},
tpl: [
'<tpl for=".">',
'<div class="thumb-wrap" id="{PicName}">',
'<div class="thumb"><img src="{PicAddress}" title="{PicName}"/></a></div>',
'<span class="x-editable">{PicName}</span></div>',
'</tpl>',
'<div class="x-clear"></div>'
],
multiSelect: true,
height: 310,
trackOver: true,
overItemCls: 'x-item-over',
itemSelector: 'div.thumb-wrap',
emptyText: 'No images to display'
})
});
var detaileForm = {
xtype: 'fieldset',
layout: 'column',
width: 500,
height: 400,
defaultType: 'textfield',
items: [
{
xtype: 'container',
columnWidth: .6,
layout: 'anchor',
items: stationColumn
}, {
xtype: 'container',
columnWidth: .4,
layout: 'anchor',
items: panel
}]
};
extjs model层代码:
Ext.define('OOOmodel.Picture', {
extend: 'Ext.data.Model',
fields: ['PicAddress', 'PicName']
});
下面的是另外的
initComponent: function () {
this.columns = [{
xtype: 'gridcolumn',
header: 'ID',
dataIndex: 'Id',
width: 100,
menuDisabled: true,
sortable: true,
renderer: function (value, metaData, record, rowIndex, columnIndex, store) {
var url = 'http://localhost:8088/Image/';
var fileName = store.getAt(rowIndex).get('PictureName');
var img = "<img src='" + url + fileName + "' width='300' height='200'>";
metaData.tdAttr = 'data-qtip="' + img + '"';
return value;
}
}];
[ExtjsAction("view")]
public ActionResult GetById()
{
string picId = GetParameter("Id");
foreach (var image in picInfo.Images)
{
image.PicAddress = "http://localhost:8088/pic/Image/" + image.PicAddress;
}
return this.JsonFormat(new ExtjsFormInfo(picInfo));
}
js页面代码:
var panel = Ext.create('Ext.Panel', {
bodyStyle: 'padding-top:5px 5px 0;background-color:#DFE9F6',
layout: {
type: 'table',
columns: 3
},
frame: true,
name: 'picPanle',
id: 'images-view',
collapsible: true,
width: 120,
title: '图片信息',
items: Ext.create('Ext.view.View', {
store: {
model: 'OOO.model.picPackage.Picture',
proxy: {
type: 'memory',
reader: {
type: 'json'
}
}
},
tpl: [
'<tpl for=".">',
'<div class="thumb-wrap" id="{PicName}">',
'<div class="thumb"><img src="{PicAddress}" title="{PicName}"/></a></div>',
'<span class="x-editable">{PicName}</span></div>',
'</tpl>',
'<div class="x-clear"></div>'
],
multiSelect: true,
height: 310,
trackOver: true,
overItemCls: 'x-item-over',
itemSelector: 'div.thumb-wrap',
emptyText: 'No images to display'
})
});
var detaileForm = {
xtype: 'fieldset',
layout: 'column',
width: 500,
height: 400,
defaultType: 'textfield',
items: [
{
xtype: 'container',
columnWidth: .6,
layout: 'anchor',
items: stationColumn
}, {
xtype: 'container',
columnWidth: .4,
layout: 'anchor',
items: panel
}]
};
extjs model层代码:
Ext.define('OOOmodel.Picture', {
extend: 'Ext.data.Model',
fields: ['PicAddress', 'PicName']
});
下面的是另外的
initComponent: function () {
this.columns = [{
xtype: 'gridcolumn',
header: 'ID',
dataIndex: 'Id',
width: 100,
menuDisabled: true,
sortable: true,
renderer: function (value, metaData, record, rowIndex, columnIndex, store) {
var url = 'http://localhost:8088/Image/';
var fileName = store.getAt(rowIndex).get('PictureName');
var img = "<img src='" + url + fileName + "' width='300' height='200'>";
metaData.tdAttr = 'data-qtip="' + img + '"';
return value;
}
}];
相关文章推荐
- jQuery缩略图功能鼠标移上显示大缩略图
- jtable中某列实现html中a标签效果,鼠标移到上面去的时候显示手型效果
- 现在我用gridview绑定到数据库,但是有一列很长,有没有办法实现当绑定的时候显示前面几个字,当鼠标放上去的时候显示全部内容,郁闷阿
- 鼠标缩略图遥感图像显示时的连动效果——Qt实现
- 当鼠标移到某一元素上时候显示提示信息,离开时提示信息也消失
- 完全css实现缩略图鼠标移上去显示大图
- 鼠标悬浮停留三秒后自动显示大图js代码
- ExtJs Grid中鼠标停留显示详细
- 完全css实现缩略图鼠标移上去显示大图
- 一个列用render渲染的时候,如果列宽度不够,内容多出的部分会被隐藏,无法显示。这时需要一个鼠标滑过提示全部内容的tip功能。
- HyperLink 鼠标经过时候显示全部文字
- 窗体中有一个图片框,显示一副图片。要求:1)在窗体打开时,动态加载图片;2)设置图片显示模式为根据图片框大小缩放图片;3)图片自己找;4)当鼠标停留在图片框时,显示“**风光”提
- 【前端积累】二级菜单,鼠标滑过的时候子菜单显示,当鼠标离开的时候子菜单隐藏
- eclipse在debug时候,可能鼠标放上去,有些变量不直接显示咋办?
- QT按钮包含图片与文字,以及鼠标停留备注显示,和sheetstyle风格设置。
- 在做商品列表的时候,鼠标触到在每一行的特定位置上,就会显示该商品的图片,移开则消失
- 窗体显示标题栏的时候,禁止鼠标拖动窗体
- 当超出宽度时候用省略号,鼠标移动到上面时候显示所有(不用tooltip插件)
- (4)鼠标移动某个区域时候显示内容,移出某个区域的时候隐藏某个内容
- 背包系统中的鼠标悬停显示物品信息