简体   繁体   English

JQGrid显示多个选择

[英]JQGrid shows multiple Selects

Non working version 非工作版本

在此处输入图片说明

be = "<a href='#'>Select</a >";
be = "<a href='#' onclick='GetEnrollmentByCIP(\"" + (rowId['CIP']) + "\")'>Select</a >";
jQuery("#grdProgramsEnrolled").jqGrid('setRowData', ids[i], { ab: be });

This is what be is in the last row when loading the grid: 这是be是加载网格时,在最后一排:

<a href='#' onclick='GetEnrollmentByCIP("52.0299")'>Select</a >

Why am I getting (2) Select statements from the above code? 为什么会得到(2)从上面的代码中选择语句?

This code only produces as single "Select" on a different screen 此代码仅在不同屏幕上作为单个“选择”产生

be = "<a href='#'>Student</a >";
be = "<a href='#' onclick='GetStudent(\"" + (rowId['UIC']) + "\")'>Student</a >";
jQuery("#grdStudentGrid").jqGrid('setRowData', ids[i], { ab: be });

This is what be is in the last row when loading the grid: 这是be是加载网格时,在最后一排:

 <a href='#' onclick='GetStudent("7910132816")'>Student</a >

The only difference that I can tell is that the string value being passed contains a decimal point? 我可以告诉的唯一区别是,传递的字符串值包含小数点? Does s 是否

From what i understand, you want to call a function depending on the row data that is selected. 据我了解,您要根据所选的行数据调用一个函数。 Instead of the onclick crammed there, you can use the custom formatter of jqgrid to do the same. 您可以使用jqgrid的自定义格式化程序来代替执行此操作,而不必在此处塞满onclick。

function myformatter ( cellvalue, options, rowObject ){
var obj = rowObject['CIP']
return '<a href ="#" onclick="GetEnrollmentByCIP(' + obj+ ')">Select</a>';
}

For details:: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter 有关详细信息:: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM