1

Say I have a grid and on clicking that button it will send that data to the grid and it will refresh automatically with new data display in the data:

$("#wics").click( function(){
    var grid = jQuery("#list10");
    var ids = grid.jqGrid('getGridParam','selarrrow');
    if (ids.length>0) {
        var names = [];
        for (var i=0, il=ids.length; i < il; i++) {
            var name = grid.jqGrid('getCell', ids[i], 'Name');
            names.push(name);
        }
        //alert ("Names: " + names.join(", ") + "; ids: " + ids.join(", "));
        $("#names").html(names.join(", "));
        $("#dialog-confirm").dialog({
            height:280,
            modal:true,
            buttons:{
                'Cancel': function(){
                    $(this).dialog('close');
                },
                'Confirm': function(){
                    //alert("Confirm");
                    $.ajax({
                        type: "POST",
                        url:  "/cpsb/unprocessedOrders.do",
                        data: { method: "releaseTowics",
                            orderNum: JSON.stringify(ids),
                            names: JSON.stringify(names)
                        },
                        dataType: "json"
                        success: function(msg){
                            alert(msg);
                        },
                        error: function(res, status, exeption) {
                            alert(res);
                        }
                    });
                }
            }
        });
    }
});

Maybe I will have to pull the new data with the success message in the grid. Basically just need to reload the grid automatically on clicking wics button.

Cœur
  • 37,241
  • 25
  • 195
  • 267
paul
  • 1,124
  • 9
  • 27
  • 45

1 Answers1

0

Probably you will find the answer to you question here: How to filter the jqGrid data NOT using the built in search/filter box?

If I correct understand your question you should replace $.ajax request to setting of url and postData parameters (correspond to data parameter of $.ajax) and page:1 on the second grid with respect of setGridParam method and call trigger('reloadGrid').

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • thanks! can i do something like after finishing that ajax call $("#list10").jqGrid("reloadGrid") in confirm message? – paul Aug 31 '10 at 00:47
  • moreover i need to do a success message with the data I just push to server...what is the best way to do that? should write a function inside the success method? – paul Aug 31 '10 at 00:48