简体   繁体   English

jqgrid选择多个单元格?

[英]jqgrid select multiple cells?

Is there a way in jqgrid to select multiple cells? jqgrid中有没有办法选择多个单元格? Ideally I want to toggle different cells and be able to restrict it in a way that only 1 cell can be toggled on in each row. 理想情况下,我想切换不同的单元格并能够以每行只能切换一个单元格的方式对其进行限制。

Is jqgrid suited for this or should I be using a different library? jqgrid是否适合此操作,还是应该使用其他库?

Your requirement reminds me the requirement to select words in the grid instead of rows. 您的要求使我想起了在网格中而不是行中选择单词的要求。 You can implement this, but jqGrid could not help you here. 您可以实现此功能,但是jqGrid在这里无济于事。 On the other side if you select a row you can use Edit or Delete navigator button to remove it. 另一方面,如果选择一行 ,则可以使用“ Edit或“ Delete导航器”按钮将其删除。 There are internal parameters selarrrow and selrow which hold the id of the selected row. 内部参数selarrrowselrow包含选定行的ID。

If you really need to implement such custom selection you can use beforeSelectRow or onCellSelect event handler to do this. 如果你真的需要实现这样的自定义选择,您可以使用beforeSelectRowonCellSelect事件处理程序来做到这一点。 Yon can save the list of selected cells in your custom variable. Yon可以将所选单元格的列表保存在您的自定义变量中。 You can use .addClass("ui-state-highlight").attr("aria-selected","true") for the <td> element instead of <tr> what jqGrid do. 您可以将.addClass("ui-state-highlight").attr("aria-selected","true")用作<td>元素,而不是<tr> jqGrid的操作。 It is important that you will be not able to use any editing features of jqGrid in the case. 在这种情况下,您将不能使用jqGrid的任何编辑功能 ,这一点很重要。

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

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