0
votes

I have Master table, from where I am trying to trigger a reload of a second (detail) table. In the Master table, onSelectRow I call .trigger("reloadGrid") to refresh the detail table. The loadOnce of the detail table is set to false.

The detail table refreshes on the client, but does not hit the server.

What is required to hit the server?

onSelectRow:
    function(id) {

        if(id == null) {

            id=0;

            if(jQuery("#addrGrid").jqGrid('getGridParam','records') >0 )

{

                jQuery("#addrGrid").jqGrid('setGridParam',{url:'${addressrecordsUrl}'+'?user_id=id',page:1});

                jQuery("#addrGrid").jqGrid('setCaption',"Address Detail: "+id);

                jQuery("#addrGrid").jqGrid('setGridParam', { datatype: "json" });
                jQuery("#addrGrid").trigger("reloadGrid");
            }
        } else {

            jQuery("#addrGrid").jqGrid('setGridParam',{url:'${addressrecordsUrl}'+'?user_id=id',page:1});

            jQuery("#addrGrid").jqGrid('setCaption',"Address Detail: "+id);

            jQuery("#addrGrid").jqGrid('setGridParam', { datatype: "json" });

            jQuery("#addrGrid").trigger("reloadGrid");
        }

    }

I am using 4.3.1 version of JQGrid.

1

1 Answers

0
votes

I found the solution for this issue. Problem is with the Parameter passing syntax which i used to pass user_id to the detail List (Sub list).

see the line

jQuery("#addrGrid").jqGrid('setGridParam',{url:'${addressrecordsUrl}'+'**?user_id=id'**,page:1});

user_id passed above is wrong (syntactically)

When i replace this with

jQuery("#addrGrid").jqGrid('setGridParam',{url:'${addressrecordsUrl}'+'?user_id='+id,page:1});

it got resolved.