<legend id='hhRf9'><style id='hhRf9'><dir id='hhRf9'><q id='hhRf9'></q></dir></style></legend>

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

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

      1. 在multiplesearch jqGrid中删除搜索运算符(AND/OR)

        时间:2023-09-04
          <i id='CWcN8'><tr id='CWcN8'><dt id='CWcN8'><q id='CWcN8'><span id='CWcN8'><b id='CWcN8'><form id='CWcN8'><ins id='CWcN8'></ins><ul id='CWcN8'></ul><sub id='CWcN8'></sub></form><legend id='CWcN8'></legend><bdo id='CWcN8'><pre id='CWcN8'><center id='CWcN8'></center></pre></bdo></b><th id='CWcN8'></th></span></q></dt></tr></i><div id='CWcN8'><tfoot id='CWcN8'></tfoot><dl id='CWcN8'><fieldset id='CWcN8'></fieldset></dl></div>
            <tbody id='CWcN8'></tbody>

              <tfoot id='CWcN8'></tfoot>

                <bdo id='CWcN8'></bdo><ul id='CWcN8'></ul>

                • <small id='CWcN8'></small><noframes id='CWcN8'>

                  <legend id='CWcN8'><style id='CWcN8'><dir id='CWcN8'><q id='CWcN8'></q></dir></style></legend>
                  本文介绍了在multiplesearch jqGrid中删除搜索运算符(AND/OR)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要在搜索弹出窗口中隐藏运算符,但我无法让它工作.我试过了,但两个运算符仍然出现:

                  I need to hide the operator in the search popup, but I cannot get it to work. I tried this, but both operators still appear:

                  
                  jQuery("#grilla").navGrid("#paginador",
                  {del:false,add:false,edit:false},{},{},{},{
                  groupOps: [{ op: "OR", text: "any" }], multipleSearch:true});
                  

                  有什么想法吗?谢谢!

                  推荐答案

                  没有选项可以直接做你需要的.此外,如果您要在对话框初始化时从搜索对话框中隐藏 ADD/OR 操作数(例如在 beforeShowSearch 事件处理程序) 与 $('select.opsel').hide() 选择元素将被隐藏仅在开头.用户单击任何按钮后,对话框包含将被重新绘制,而无需调用任何事件处理程序,并且选择元素将再次可见.

                  There are no option which can directly do what you need. Moreover if you would hide the ADD/OR operand from the searching dialog at the dialog initialization (for example inside of beforeShowSearch event handler) with $('select.opsel').hide() the select element will be hidden only at the beginning. After the user click on any button the dialog contain will be repaint without calling of any event handler and the select element will be again visible.

                  所以我建议通过覆盖方法来解决问题 reDraw.执行此操作的代码如下所示

                  So I suggest to solve the problem with overwriting the method reDraw of the filter dialog. The code which do this can look like

                  jQuery("#grilla").jqGrid("navGrid","#paginador",
                      {del: false, add: false, edit: false}, {}, {}, {},
                      {
                          multipleSearch: true,
                          beforeShowSearch: function($form) {
                              var searchDialog = $form[0],
                                  oldrReDraw = searchDialog.reDraw, // save the original reDraw method
                                  doWhatWeNeed = function () {
                                      // hide the AND/OR operation selection
                                      $('select.opsel', searchDialog).hide();
                  
                                      setTimeout(function () {
                                         // set fucus in the last input field
                                         $('input[type="text"]:last', searchDialog).focus();
                                      }, 50);
                                  }
                              searchDialog.reDraw = function () {
                                  oldrReDraw.call(searchDialog);    // call the original reDraw method
                                  doWhatWeNeed();
                              }
                              doWhatWeNeed();
                          }
                      }
                  );
                  

                  您可以在 演示上看到这种方法确实有效.

                  You can see on the demo that the way really works.

                  更新:写完答案后,我向 trirand 提出了一些改进 jqGrid 的建议.现在 jqGrid 有许多功能可以简化上述工作.例如存在可以直接使用的 afterRedraw 回调.所以答案中的代码看起来像

                  UPDATED: After writing of the answer I posted some suggestions to trirand to improve jqGrid. Now jqGrid has many features which simplify the above work. For example there are exist afterRedraw callback which can be directly used. So the code from the answer will look like

                  grid.jqGrid("navGrid", "#pager",
                      {add: false, edit: false, del: false}, {}, {}, {},
                      {
                          multipleSearch: true,
                          afterRedraw: function (p) {
                              var $form = $(this);
                              $form.find("select.opsel").hide();
                              setTimeout(function () {
                                 // set fucus in the last input field
                                 $form.find('input[type="text"]:last').focus();
                              }, 50);
                              $form.find("input.add-rule,input.delete-rule").button();
                          }
                      }
                  );
                  

                  查看修改后的演示这里:

                  我在afterRedraw

                  $form.find("input.add-rule,input.delete-rule").button();
                  

                  仅用于改善搜索对话框中按钮的外观.我建议在 jqGrid 中将此类设置设为默认值,但这并未被 trirand 接受.无论如何,每个包含 jQuery UI 的人都可以在 afterRedraw 中添加这样的行来使按钮变平.

                  only to improve the look of buttons in the Searching Dialog. I suggested to make such settings default in jqGrid, but this was not accepted by trirand. In any way everyone who includes jQuery UI can add such line in afterRedraw to make the buttons flat.

                  这篇关于在multiplesearch jqGrid中删除搜索运算符(AND/OR)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 jqgrid 高级搜索对话框中本地化按钮工具提示 下一篇:如何向我的 jqgrid 添加取消按钮?

                  相关文章

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

                  1. <tfoot id='gCQHO'></tfoot>

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

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