4

Here is my code:

    $('#ShowName').autocomplete({
        delay: 600,
        minLength: 0,
        source: function (request, response) {
            $.ajax({
                url: '<%: Url.Content("~/Case/FilterShowName") %>',
                data: getData(),
                success: function (data) { response(data); },
                dataType: "json"
            });
        },
        select: function (event, ui) {
            var data = getData();
            data.ShowName = ui.item.label;
            $("#list").setGridParam('postData', data);
            $("#list").trigger("reloadGrid");
        }
    });

As you can see, when an item is selected on $('#ShowName') I want to reload my $("#list")'s jqGrid. But when I do that, the new postData's values is never sended. Only the old values are sended to ~/Case/FilterShowName

I see different solution on Stackoverflow by recreating the entire grid. This is realy necessary?

Thank you!

Tuizi
  • 1,643
  • 4
  • 22
  • 34

1 Answers1

3

You should do:

$("#list").setGridParam({'postData': data});

Then it should work.

Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273