Author Topic: How to refresh data in grid  (Read 2112 times)

sam.shah

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 13
    • View Profile
How to refresh data in grid
« on: March 16, 2018, 10:28:07 am »
I tried to call  grid = $("#grid_editing").pqGrid('refreshDataAndView');
which make ajax call,but with old data of parameter.
Let me explain in brief:- I have 4-dropdownlist to filter data.
After loading grid first time,I have one search button where I am calling grid = $("#grid_editing").pqGrid('refreshDataAndView');.
It's not getting latest values of parameter.
Please help me.

 $("#btnGo").click(function () {
               
                if (validateScenario() == true) {
                    StartWeek = $('#txtDate').datepick('getDate');
                    StartWeek = convert(StartWeek);
                    Site = $('#ddlSite').val();
                    console.log(Site);
                    TimePeriod = $('#ddlTimePeriod').val();
                    ScenarioName = $('#txtScenarioName').val();
                    ScenarioDesc = $('#txtScenarioDesc').val();
                    Sid = $('#Sid').val();
                    grid = $("#grid_editing").pqGrid('refreshDataAndView');
              }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: How to refresh data in grid
« Reply #1 on: March 16, 2018, 05:19:44 pm »
I understand from your code that you pass parameters to remote script through postData.

You need to update value of postData with new parameters.