0

I have tried to follow question in stackoverflow, but this doesn't help me in my case. I have a checkbox on my web-page, which if gets clicked(true) shows, only negative values. I am trying to send data from my JS file to Controllers with change parameters so the grid with negative values comes up. But I am not getting any hit on controller while debugging it.

//Check for Negative Option
       var negative;
       $('#checkbox').click(function(){
       {
           var selected= $('#txtSelected').val();
           var summary=$("#chkSummary").is(":checked");
           var negative = $("#checkbox").is(":checked");
           var locationIdList=$('#locationId').val()
           ReloadGrid(selected, summary, negative, locationIdList);
       }
      })

Where StatusGridId is the name of my table.

 function ReloadGrid(selected,summary,negative,locationId) {
        $("#StatusGridId").jqGrid('clearGridData');
        //Reload grid trigger
        $("#StatusGridId").jqGrid('setGridParam',
        {
            url: "/Reports/GetStatus?"+"locationIdList="+locationId,
            postData:{selected: selected, summary:summary, negative: negative}
        }).trigger('reloadGrid');
    }

My controller where I am not reciving any hit while debugging:

 public JsonResult GetStatus ( string sidx, string sord, int? page, int? rows, string selected, string locationIdList, bool? summary, bool? negative )
{
-----code------
}
  • Check to see what parameters are posted to you server when you check the box. Use debug console to see it. By the way it is a good idea to know which version of jqGrid is used. – Tony Tomov Aug 02 '21 at 12:41
  • jqGrid 4.4.4 - jQuery Grid This is the version of JqGrid I'm using – Anirudh Singh Rawat Aug 02 '21 at 12:49
  • When you see the debug console ( press F12 to open it) - what parameter are posted to the server. If the negative parameter is posted, then you have problems with accepting it at server and return the appropriate result. – Tony Tomov Aug 03 '21 at 08:29

0 Answers0