0

我在网格上进行内联编辑,我想在编辑或添加或删除一行后重新加载我的 jqgrid,CRUD 方法工作正常,但网格没有重新加载!这是我的jsp文件:

<s:url id="remoteurlApplication" action="applicationList" />
    <s:url id="editurlApplication" action="applicationEdit" />
    <sjg:grid 
            id="idGridApplication"

            caption="Liste des applications"
            dataType="json"
            href="%{remoteurlApplication}"
            pager="true"
            navigator="true"
            navigatorSearchOptions="{sopt:['eq','ne','lt','gt']}"
            navigatorAddOptions="{height:150,reloadAfterSubmit:true}"
            navigatorEditOptions="{height:150,reloadAfterSubmit:true}"
            navigatorEdit="false"
            navigatorView="false"
            navigatorDelete="true"
            navigatorDeleteOptions="{height:150,reloadAfterSubmit:true}"
            gridModel="gridApplications"
            rowList="10,15,20"
            rowNum="15"
            editurl="%{editurlApplication}"
            editinline="true"
            viewrecords="true"
            width="1000"
            shrinkToFit="false"
        >
        <sjg:gridColumn hidden="true" name="idApplication" index="idApplication" 
                        title="ID" formatter="integer"
                        editable="true" sortable="false" width="300"
        />
        <sjg:gridColumn name="nomApplication" frozen="true" title="application" 
                        editable="true" edittype="text" 
                        width="700"
        />
    </sjg:grid>

这是我的 js 文件:

$.subscribe('rowadd', function(event,data) {
    $("#idGridApplication").jqGrid('editGridRow',"new",{height:280,reloadAfterSubmit:false});
});
$.subscribe('searchgrid', function(event,data) {
    $("#idGridApplication").jqGrid('searchGrid', {sopt:['cn','bw','eq','ne','lt','gt','ew']} );
});
$.subscribe('showcolumns', function(event,data) {
    $("#idGridApplication").jqGrid('setColumns',{});
});
4

1 回答 1

0
$.subscribe('rowadd', function(event,data) {

  $("#idGridApplication").jqGrid('GridUnload');   

  $("#idGridApplication").jqGrid('editGridRow',"new",{height:280,reloadAfterSubmit:false});

});

您可以使用 jqGrid 卸载功能。

$("[#NAME]")jqGrid('GridUnload');
于 2014-02-06T11:09:06.727 回答