<i id='SlT0d'><tr id='SlT0d'><dt id='SlT0d'><q id='SlT0d'><span id='SlT0d'><b id='SlT0d'><form id='SlT0d'><ins id='SlT0d'></ins><ul id='SlT0d'></ul><sub id='SlT0d'></sub></form><legend id='SlT0d'></legend><bdo id='SlT0d'><pre id='SlT0d'><center id='SlT0d'></center></pre></bdo></b><th id='SlT0d'></th></span></q></dt></tr></i><div id='SlT0d'><tfoot id='SlT0d'></tfoot><dl id='SlT0d'><fieldset id='SlT0d'></fieldset></dl></div>
        <tfoot id='SlT0d'></tfoot>

        <small id='SlT0d'></small><noframes id='SlT0d'>

          <bdo id='SlT0d'></bdo><ul id='SlT0d'></ul>
      1. <legend id='SlT0d'><style id='SlT0d'><dir id='SlT0d'><q id='SlT0d'></q></dir></style></legend>
      2. jqGrid中onCellSelect函数的完全相反是什么?

        时间:2023-09-04
        <legend id='D64Gd'><style id='D64Gd'><dir id='D64Gd'><q id='D64Gd'></q></dir></style></legend>

        • <bdo id='D64Gd'></bdo><ul id='D64Gd'></ul>
          <tfoot id='D64Gd'></tfoot>
            <i id='D64Gd'><tr id='D64Gd'><dt id='D64Gd'><q id='D64Gd'><span id='D64Gd'><b id='D64Gd'><form id='D64Gd'><ins id='D64Gd'></ins><ul id='D64Gd'></ul><sub id='D64Gd'></sub></form><legend id='D64Gd'></legend><bdo id='D64Gd'><pre id='D64Gd'><center id='D64Gd'></center></pre></bdo></b><th id='D64Gd'></th></span></q></dt></tr></i><div id='D64Gd'><tfoot id='D64Gd'></tfoot><dl id='D64Gd'><fieldset id='D64Gd'></fieldset></dl></div>

              <small id='D64Gd'></small><noframes id='D64Gd'>

                  <tbody id='D64Gd'></tbody>
                • 本文介绍了jqGrid中onCellSelect函数的完全相反是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的代码 -

                   onCellSelect: function(rowid,iRow,iCol,e)
                    {
                          jQuery("#createrule").click(function(){
                          hidePopup();
                          showPopUp6();
                        });     
                     onCellSelect:
                  

                  },

                  jqGrid中onCellSelect函数的正反面是什么?

                  What is the exact reverse of onCellSelect function in jqGrid?

                  推荐答案

                  如果用户在网格中单击,您不应该每次都注册新的 click 事件处理程序.

                  You should don't register new click event handler every time if the user click in the grid.

                  jqGrid 在创建网格期间注册 click 事件处理程序之一.因此,如果用户单击网格的某个单元格,您可以执行一些操作.rowidiCol 参数帮助您识别单击了哪个单元格和 e 参数(click 的 Event 对象event) 可以在需要时为您提供更多信息.jqGrid 是开源项目.因此,您可以随时检查源代码以更好地了解 onCellSelect 的作用以及将在哪个上下文中调用它.查看 行代码.

                  jqGrid register click event handler one during creating the grid. So you can do some actions in case of user click on some cell of the grid. Parameters rowid and iCol helps you to identify which cell was clicked and the e parameter (the Event object of click event) could gives you even more information if required. jqGrid is Open Source project. So you can any time examine the source code to understand better what onCellSelect do and in which context it will be called. Look at the lines of code.

                  只是一个例子你可以定义以下格式化程序

                  Just an example You can define the following formatter

                  formatter: function (cellValue, options, rowObject) {
                      return "<span class='myLink'>" + cellValue + "</span>";
                  }
                  

                  在名为myColumn"的列中并定义以下使用 myLink 类的 CSS 规则

                  in the column with the name "myColumn" and define the following CSS rule which uses myLink class

                  .myLink { text-decoration: underline; cursor: pointer; }
                  

                  列中会有链接".

                  要检测用户点击了此类伪链接,您可以使用以下 onCellSelect 回调

                  To detect that the user clicks on such pseudo-link you can use the following onCellSelect callback

                  onCellSelect: function (rowid, iRow, iCol, e) {
                      var $self = $(this), colModel = $self.jqGrid("getGridParam", "colModel");
                      if (colModel[iCol].name === "myColumn") { // test for the click in myColumn column
                          alert("OK here we can do something");
                      }
                  }
                  

                  警报将在点击列中的所有位置时显示,而不仅仅是在链接上.如果您只想检测链接上的点击,那么我们应该测试 e.tagret 这是用户点击的元素:

                  The alert will be displayed on click everywhere in the column, not only on the link. If you want to detect clicking only on the link then we should test e.tagret which is the element which was clicked by the user:

                  onCellSelect: function (rowid, iRow, iCol, e) {
                      var $self = $(this), colModel = $self.jqGrid("getGridParam", "colModel");
                      if (colModel[iCol].name === "myColumn" && $(e.tagret).hasClass("myLink")) {
                          alert("OK, link is clicked and here we can do something");
                      }
                  }
                  

                  所以 onCellSelect 可用于处理网格每个单元格上的 click 事件.如果您需要另外禁止选择网格,则应使用 beforeSelectRow 而不是 onCellSelect.例如,请参阅答案.

                  So onCellSelect can be used to handle click event on every cell of the grid. If you need to suppress selection of the grid additionally then you should use beforeSelectRow instead of onCellSelect. See the answer for example.

                  这篇关于jqGrid中onCellSelect函数的完全相反是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:是否可以隐藏或操作 jqGrid“排序"?图标? 下一篇:在 jqGrid 中重新加载 dataurl 元素

                  相关文章

                • <legend id='LFd5G'><style id='LFd5G'><dir id='LFd5G'><q id='LFd5G'></q></dir></style></legend>

                  <tfoot id='LFd5G'></tfoot>
                    <bdo id='LFd5G'></bdo><ul id='LFd5G'></ul>
                  <i id='LFd5G'><tr id='LFd5G'><dt id='LFd5G'><q id='LFd5G'><span id='LFd5G'><b id='LFd5G'><form id='LFd5G'><ins id='LFd5G'></ins><ul id='LFd5G'></ul><sub id='LFd5G'></sub></form><legend id='LFd5G'></legend><bdo id='LFd5G'><pre id='LFd5G'><center id='LFd5G'></center></pre></bdo></b><th id='LFd5G'></th></span></q></dt></tr></i><div id='LFd5G'><tfoot id='LFd5G'></tfoot><dl id='LFd5G'><fieldset id='LFd5G'></fieldset></dl></div>

                    1. <small id='LFd5G'></small><noframes id='LFd5G'>