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

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

        <i id='hdyk6'><tr id='hdyk6'><dt id='hdyk6'><q id='hdyk6'><span id='hdyk6'><b id='hdyk6'><form id='hdyk6'><ins id='hdyk6'></ins><ul id='hdyk6'></ul><sub id='hdyk6'></sub></form><legend id='hdyk6'></legend><bdo id='hdyk6'><pre id='hdyk6'><center id='hdyk6'></center></pre></bdo></b><th id='hdyk6'></th></span></q></dt></tr></i><div id='hdyk6'><tfoot id='hdyk6'></tfoot><dl id='hdyk6'><fieldset id='hdyk6'></fieldset></dl></div>
        • <bdo id='hdyk6'></bdo><ul id='hdyk6'></ul>
      1. <tfoot id='hdyk6'></tfoot>
      2. Struts 2 jQuery 网格从 JSON 字符串加载数据

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

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

                    <tbody id='kIJcI'></tbody>
                  <tfoot id='kIJcI'></tfoot>
                  本文介绍了Struts 2 jQuery 网格从 JSON 字符串加载数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我发现我们可以用 JSON 字符串加载 jqGird.

                  I found that we can load the jqGird with JSON string.

                  请参考将JSON数据映射到jqGrid.

                  是否可以将此功能与 sjg:grid 标签一起使用?

                  Is it possible to use this feature with sjg:grid tag?

                  我查看了标签属性,只发现可以从 URL 加载数据,该 URL 将调用 Struts 动作并且该动作返回 JSON 数据,但在我的程序中我已经有了 JSON 值,需要将其传递给jqGird.

                  I look at tag attribute and only find that the data can be loaded from a URL which will call a Struts action and that action returns a JSON data, but in my program I already have the JSON value and need to pass it to jqGird.

                  如果标签不支持数据,使用 Struts 2 jQuery 插件中包含的 jqGrid 的最佳方式是什么.

                  If the tag does not support data, what is the best way to use jqGrid which are included in Struts 2 jQuery plugin.

                  推荐答案

                  dataType="local" 设置为 sjg:grid 并移除 href 属性.然后提供数组中的行数据.例如

                  Set the dataType="local" to the sjg:grid and remove href attribute. Then provide row data from the array. For example

                  <sjg:grid
                      id="gridtable"
                      caption="Example (Editable/Multiselect)"
                      dataType="local"
                      pager="true"
                      navigator="true"
                      navigatorSearchOptions="{sopt:['eq','ne','lt','gt']}"
                      navigatorAddOptions="{height:280, width:500, reloadAfterSubmit:true}"
                      navigatorEditOptions="{height:280, width:500, reloadAfterSubmit:false}"
                      navigatorEdit="true"
                      navigatorView="true"
                      navigatorViewOptions="{height:280, width:500}"
                      navigatorDelete="true"
                      navigatorDeleteOptions="{height:280, width:500,reloadAfterSubmit:true}"
                      gridModel="gridModel"
                      rowList="5,10,15"
                      rowNum="5"
                      rownumbers="true"
                      editurl="%{editurl}"
                      editinline="true"
                      multiselect="true"
                      onSelectRowTopics="rowselect"
                      >
                  
                      <sjg:gridColumn name="id" index="id" title="Id" formatter="integer" editable="false" sortable="true" search="true" sorttype="integer" searchoptions="{sopt:['eq','ne','lt','gt']}"/>
                      <sjg:gridColumn name="name" index="name" key="true" title="Country Name" editable="true" edittype="text" sortable="true" search="true" sorttype="text"/>
                  
                  </sjg:grid>
                  <script type="text/javascript">
                    $(document).ready(function(){
                      var mydata = [{id:"1",name:"Roman C"}];
                      //for(var i=0;i<=mydata.length;i++) $("#gridtable").jqGrid('addRowData',i+1,mydata[i]);
                      $("#gridtable").jqGrid('setGridParam', {
                          data: mydata
                      }).trigger("reloadGrid");
                    });
                  </script>
                  

                  这篇关于Struts 2 jQuery 网格从 JSON 字符串加载数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何从 Struts 2 中的选定对象中获取对象属性 下一篇:Struts 2 和 Hibernate 中的异常处理

                  相关文章

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

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

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