我有一个jqgrid,在第三列有一个link(),我想在用户点击jqgrid列的链接时在facebox或模型框中显示页面。我试过但它只是打开一个不在facebox或模型框中的页面。这是代码。
colNames:['Index','Group Name', 'Exer Name','Details'],
colModel:[
{name:'exerId',index:'exerId', width:65, sorttype:'int'},
{name:'exGroupName',index:'exGroupName', width:150},
{name:'exerName',index:'exerName', width:100},
{name:'view',index: 'view', search:false, align: 'center',width:100},
],
gridComplete: function () {
var ids = jQuery("#toolbar").jqGrid('getDataIDs');
for (var i = 0; i < ids.length; i++) {
var cl = ids[i];
be = "<a href='<%= request.getContextPath()%>/jsps/tools.jsp' rel='facebox'>Slet</a>";
jQuery("#toolbar").jqGrid('setRowData', ids[i], { view: be });
}
},
我将这个脚本用于facebox。
<link href="<%= request.getContextPath()%>/scripts/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="<%= request.getContextPath()%>/scripts/facebox/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : '<%= request.getContextPath()%>/scripts/facebox/loading.gif',
closeImage : '<%= request.getContextPath()%>/scripts/facebox/closelabel.png'
})
})
</script>