我在我的应用程序中使用 jqgrid 和 prettyphoto。
我有一列显示图像预览。单击该图像时,该图像将显示在弹出框中。
网格代码是..
.....
{name: 'imagePath', index: 'imagePath', width: 80, align: 'center',
formatter :anchorFmatter, edittype: 'text', hidden: false, editable: true,
editrules: {required: false}, editoptions: {size: 30}}
....
function anchorFmatter(cellValue, options, rowObject)
{
if(cellValue === null ){
return "<a></a>";
}else {
jQuery("a[rel='image']").prettyPhoto({
animation_speed:'normal',
show_title:false,
allow_resize:true,
default_width:640,
default_height:385,
theme:'light_rounded',
autoplay:false
});
return "<a href='" + cellValue + "' rel='image'><img src='" + cellValue +
"' width='100' height='35'></a>";
}
}
网格中的所有图像都出现在弹出窗口中,但最后一张图像出现在新的浏览器页面中。
可能会得到任何帮助。
提前致谢