【发布时间】:2013-11-18 02:36:39
【问题描述】:
我有 2 个 jqgrid,1 个有一个 QuestionID 列,另一个表 QuestionID 是它的行。
Grid for Quiz1
rownumber | QuestionID | Text
1 | 12 | What color do you like?
2 | 15 | Where do you stay?
3 | 21 | What's your favorite food?
....
Grid2
rownumber | Student | Q1 *QuestionID = 12* | Q2 *QuestionID = 15* | Q3 *QuestionID = 21*|..
1 | Mary | Correct | Wrong | Correct |
2 | John | Wrong | Correct | Correct |
3 | Tim | Wrong | Wrong | Correct |
当我将鼠标悬停在 Quiz1 中的一行时,如何为 Grid 2 添加 colModel 属性类。 例如,如果用户在 Quiz1 中将鼠标悬停在 row3 = QuestionID = 21,那么在 Grid2 中,Q3 列将被突出显示。
这是我的javascript
$("#tbl_Quiz tr").mouseover(function (e) {
$("#tbl_Grid2 tr").jqGrid('setColProp', 'Q3', { classes: 'colHighlight' });
});
上面的代码只是为了测试它是否会突出显示列,如果成功我需要动态突出显示列。
有没有办法做到这一点?如果有人可以帮助我,我真的很感激。
【问题讨论】: