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

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

        在 jqGrid 中重新加载 dataurl 元素

        reloading dataurl elements in jqGrid(在 jqGrid 中重新加载 dataurl 元素)
          <bdo id='E7V4b'></bdo><ul id='E7V4b'></ul>
        • <legend id='E7V4b'><style id='E7V4b'><dir id='E7V4b'><q id='E7V4b'></q></dir></style></legend>
          <i id='E7V4b'><tr id='E7V4b'><dt id='E7V4b'><q id='E7V4b'><span id='E7V4b'><b id='E7V4b'><form id='E7V4b'><ins id='E7V4b'></ins><ul id='E7V4b'></ul><sub id='E7V4b'></sub></form><legend id='E7V4b'></legend><bdo id='E7V4b'><pre id='E7V4b'><center id='E7V4b'></center></pre></bdo></b><th id='E7V4b'></th></span></q></dt></tr></i><div id='E7V4b'><tfoot id='E7V4b'></tfoot><dl id='E7V4b'><fieldset id='E7V4b'></fieldset></dl></div>

        • <tfoot id='E7V4b'></tfoot>

              <tbody id='E7V4b'></tbody>

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

                1. 本文介绍了在 jqGrid 中重新加载 dataurl 元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个带有以下选项的简单网格:

                  I have a simple grid with the following options:

                  jQuery("#mygrid").jqGrid({
                     url: 'dataurl.htm',
                     datatype: 'json',
                     ajaxSelectOptions: { cache: false }
                     ...
                     colModel: [
                      { name: 'foo', index: 'foo', width: 25, stype: 'select', searchoptions:{ sopt:       
                       ['eq'], dataUrl: 'someurl.htm?columnName=foo'}}
                      ]
                  });
                  

                  但是,当我调用 $("#mygrid").trigger("reloadGrid"); 时,它只从 dataurl.htm 加载表的数据,但是它不会从 some url.htm 链接加载 foo 列的数据.

                  However, when I call $("#mygrid").trigger("reloadGrid"); it only loads the data for the table from dataurl.htm but it does not load the data for the foo column from the some url.htm link.

                  我在 SO 上阅读了几个类似的问题,建议使用 ajaxSelectOptions: { cache: false } 但这对我不起作用.

                  I've read couple of questions like these on SO and it was suggested to have ajaxSelectOptions: { cache: false } but this is not working for me.

                  someurl.htm 返回 <select><option val=''>something</option></select>

                  推荐答案

                  绝对正确的问题!jqGrid 目前的实现只有toggleToolbar 方法可以隐藏工具栏,但工具栏本身会被创建一次.因此工具栏的所有属性始终保持不变.

                  It's absolutely correct question! The current implementation of jqGrid has only toggleToolbar method which can hide the toolbar, but the toolbar itself will be created once. So all properties of the toolbar stay unchanged the whole time.

                  为了解决这个问题,我编写了一个非常简单的附加方法 destroyFilterToolbar:

                  To fix the problem I wrote small additional method destroyFilterToolbar which is pretty simple:

                  $.jgrid.extend({
                      destroyFilterToolbar: function () {
                          "use strict";
                          return this.each(function () {
                              if (!this.ftoolbar) {
                                  return;
                              }
                              this.triggerToolbar = null;
                              this.clearToolbar = null;
                              this.toggleToolbar = null;
                              this.ftoolbar = false;
                              $(this.grid.hDiv).find("table thead tr.ui-search-toolbar").remove();
                          });
                      }
                  });
                  

                  演示使用该方法.更改某些列的属性后,可以重新创建搜索工具栏.在下面的代码中,可以从搜索工具栏中更改某些文本的语言:

                  The demo uses the method. One can recreate searching toolbar after changing of properties of some columns. In the code below one can change the language of some texts from the searching toolbar:

                  对应的代码如下:

                  $("#recreateSearchingToolbar").change(function () {
                      var language = $(this).val();
                  
                      // destroy searching toolbar
                      $grid.jqGrid("destroyFilterToolbar");
                  
                      // set some searching options
                      $grid.jqGrid("setColProp", "closed",
                          language === "de" ?
                                  {searchoptions: {value: ":Beliebig;true:Ja;false:Nein"}} :
                                  {searchoptions: {value: ":Any;true:Yes;false:No"}});
                      $grid.jqGrid("setColProp", "ship_via",
                          language === "de" ?
                                  {searchoptions: {value: ":Beliebig;FE:FedEx;TN:TNT;IN:Intim"}} :
                                  {searchoptions: {value: ":Any;FE:FedEx;TN:TNT;IN:Intim"}});
                  
                      // create new searching toolbar with nes options
                      $grid.jqGrid("filterToolbar", {stringResult: true, defaultSearch: "cn"});
                  });
                  

                  这篇关于在 jqGrid 中重新加载 dataurl 元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                  Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                  How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                  How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                  • <small id='JeVRA'></small><noframes id='JeVRA'>

                      <bdo id='JeVRA'></bdo><ul id='JeVRA'></ul>
                          <tbody id='JeVRA'></tbody>

                        <legend id='JeVRA'><style id='JeVRA'><dir id='JeVRA'><q id='JeVRA'></q></dir></style></legend><tfoot id='JeVRA'></tfoot>

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