Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:09:17+00:00 2026-06-05T10:09:17+00:00

I am attempting to actually get my jqGrid to load data on a button

  • 0

I am attempting to actually get my jqGrid to load data on a button click… So far I have my button ready to be clickable as you can see. The problem is, I some how or the other not getting the navigation info correct… I am trying to AJAX call an that is set up using @HTML.BeginForm like so…

@using(Html.BeginForm("returnJSONEncoutnerData", "AddEncounter", new { popId = (int)TempData["POPULATIONID"]}, FormMethod.Post, new { id = "SearchPatID" }))

And here is my button click function.

$('#submit').click(function (event) {
        //alert("What the FONK is going on here!");
        debugger;
        var theURL = $("#SearchPatID").action;
        var type = $("#SearchPatID").methd;
        event.preventDefault();
        $.ajax({
            url: this.action,
            type: this.method,
            data: $(this).serialize(),
            dataType: "json",
            success: function (result) {
                bindCustomers();
            }
        });
        return false;
    });

My function bindCustomer is supposed to fill a jqGrid with JSON data that the above method collects and JSONifies!
I thought I would put it out there to quench your curiosity.

 var bindCustomers = function () {
    alert('');
    $("#list").jqGrid({
        url: $("#DisplayUniqueEncounters").attr("action"), //'/Home/GridData/',
        gridview: false,
        shrinkToFit: false,
        autowidth: true,
        datatype: 'json',
        mtype: 'POST',
        colNames: ['Edit',
                   'MRN',
                   'Hospital Fin',
                   'First Name',
                   'Last Name',
                   'Date of birth',
                   'Completed Pathway',
                   'Completed Pathway Reason',
                   'PCP Appointment',
                   'Specialist Appointment',
                   'Admit Date',
                   'Discharge Date',
                   'Discharge Disposition',
                   'Discharge To',
                   'Discharge Advocate Call',
                   'Home Healthcare',
                   'Safe Landing Accepted',
                   'PCP Name',
                   'PCP Phone',
                   'PCP Appointment Location',
                   'Specialist Name',
                   'Specialist Phone',
                   'Specialist Appointment Location',
                   'Comments',
                   'Patient Room Phone',
                   'Phone',
                   'Payor',
                   'MRN Type'
                   ],
        colModel: [
                   { name: 'Edit', width: 95, align: 'left' },
                   { name: 'MRN', width: 125, align: 'left' },
                   { name: 'Hospital_Fin', width: 145, align: 'left' },
                   { name: 'First_Name', width: 115, align: 'left' },
                   { name: 'Last_Name', width: 115, align: 'left' },
                   { name: 'Date_of_birth', width: 145, align: 'left' },
                   { name: 'Completed_Pathway', width: 125, align: 'left' },
                   { name: 'Completed_Pathway_Reason', width: 165, align: 'left' },
                   { name: 'PCP_Appointment', width: 115, align: 'left' },
                   { name: 'Specialist_Appointment', width: 125, align: 'left' },
                   { name: 'Admit_Date', width: 185, align: 'left' },
                   { name: 'Discharge_Date', width: 185, align: 'left' },
                   { name: 'Discharge_Disposition', width: 155, align: 'left' },
                   { name: 'Discharge_To', width: 85, align: 'left' },
                   { name: 'Discharge_Advocate_Call', width: 155, align: 'left' },
                   { name: 'Home_Health_Care_Accepted', width: 105, align: 'left' },
                   { name: 'Safe_Landing_Accepted', width: 165, align: 'left' },
                   { name: 'PCP_Name', width: 85, align: 'left' },
                   { name: 'PCP_Phone', width: 85, formatter: formatPhoneNumber, align: 'left' },
                   { name: 'PCP_Appointment_Location', width: 185, align: 'left' },
                   { name: 'Specialist_Name', width: 195, align: 'left' },
                   { name: 'Specialist_Phone', width: 135, formatter: formatPhoneNumber, align: 'left' },
                   { name: 'Specialist_Appointment_Location', width: 185, align: 'left' },
                   { name: 'Comments', width: 185, align: 'left' },
                   { name: 'Patient_Room_Phone', width: 135, formatter: formatPhoneNumber, align: 'left' },
                   { name: 'Phone', width: 125, formatter: formatPhoneNumber, align: 'left' },
                   { name: 'Payor', width: 155, align: 'left' },
                   { name: 'MRN_Type', width: 135, align: 'left' }
                   ],
        //pager: jQuery('#pager'),
        rowNum: 10,
        rowList: [5, 10, 20, 50],
        sortname: 'Id',
        sortorder: "desc",
        viewrecords: true,
        imgpath: '/scripts/themes/coffee/images',
        caption: 'My first grid'
    });
}

I need data to be thrown back at me asynchronously at some point. But beggers can’t be chosers at this point. I need to figure out why I can’t get the correct routing information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:09:20+00:00Added an answer on June 5, 2026 at 10:09 am

    this is the button, not the form.
    It doesn’t have an action.

    You should handle the form’s submit event instead, so that this will be the form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting/struggling to get registration and sign-up working within an active admin project. I have
I am attempting to automate the entry of data into form fields. The problem
I'm attempting to use jqgrid. Unfortunately, I can't compute a resultset size because I'm
Attempting to upload a video, and this is the response I get back (after
Attempting to use the data series from this example no longer passes the JSONLint
I'm fairly new to unit testing and we are actually attempting to use it
I'm attempting to setup a MenuItem that will have a submenu of page numbers
Another thanks to SLaks for helping me get the code this far. I'm not
I'm trying to change the background color of my MPMoviePlayerController, and I can't get
I am attempting to get the innerHTML of the next element, next to which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.