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

  • Home
  • SEARCH
  • 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 8353029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:08:30+00:00 2026-06-09T09:08:30+00:00

$(#addressList).jqGrid({ url: ‘/Storage/Shipping/GetCustomerAddresses?q=2&Customerid=’ + $(#saveCustomerID).val(), datatype: Json, jsonReader: { root: Data.rows, page: Data.page, total:

  • 0
        $("#addressList").jqGrid({
        url: '/Storage/Shipping/GetCustomerAddresses?q=2&Customerid=' + $("#saveCustomerID").val(),
        datatype: "Json",
        jsonReader: {
            root: "Data.rows",
            page: "Data.page",
            total: "Data.total",
            records: "Data.records",
            repeatitems: true,
            userdata: "userdata",
            cell: "cell"
        },
        colNames: ['', 'Line 1', 'Line 2', 'City', 'State'],
        colModel: [
                         { name: 'myradio', width: 30, fixed: true, align: 'center', resizable: false, sortable: false,
                             formatter: function (cellValue, option) {
                                 return '<input type="radio" name="radio_' + option.gid + '" />';
                             } 
                         },
                         { name: 'Line1', index: 'Line1', width: 250 },
                         { name: 'Line2', index: 'Line2', width: 250 },
                         { name: 'City', index: 'City', width: 210 },
                         { name: 'State', index: 'State', width: 75 }
                    ],
        page: 1,
        rowNum: 50,
        rowList: [20, 50, 100],
        pager: '#pager',
        viewrecords: true,
        grouping: false,
        caption: "Addresses",
        mtype: "POST",
        width: "100%",
        height: "100%",
        loadonce: true,
        sortable: false,
        beforeSelectRow: function (rowid, e) {
            var radio = $(e.target).closest('tr').find('input[type="radio"]');
            radio.attr('checked', 'checked');
            $("#saveCustomerAddressID").val(rowid.toString());
            return true; // allow row selection
        },
        loadComplete: function () {
            var grid_ids = $("#addressList").jqGrid('getDataIDs');
            for (var i = 0; i < grid_ids.length; i++) {
                if ($("#saveCustomerAddressID").val() == grid_ids[i]) {
                    {
                        $("#addressList").jqGrid('setSelection', grid_ids[i], true);

                    }
                }
            }
        }
        //, postdata: { CustomerID: $("#saveCustomerID").val() }
    }); 

The above code sets the selection correctly in loadcomplete. The $(“#saveCustomerAddressID”).val() is the rowid fro the JSON Data.
The radiobutton is set in the beforeSelectRow. I know the row number and grid column of of the radiobutton to be set, but how do you set the radiobutton?

  • 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-09T09:08:32+00:00Added an answer on June 9, 2026 at 9:08 am

    if you have row number and grid column, then it shouldn’t be difficult. get the id(css) of that column where you have your radio button(check developer tools for this). now lets say that radio button is in a column name “Demo”

    so the id would look like something like this i suppose

    var demo= $("'#'+rowid+'Demo'")//check developer tools for confirmation
    
    demo.attr('checked', 'checked');
    $("#saveCustomerAddressID").val(rowid.toString());//continue with you loadComplete code
    

    and for set selection use setSelection method of jqgrid after this continue with your code of loadcomplete

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

Sidebar

Related Questions

namespace MyOldService { public MyNewService.AddressList ToPrivateAddressList() { MyNewService.AddressList privAddrList = new MyNewService.AddressList(); privAddrList.creator =
I used this hostInfo.AddressList to get the machine IP address. It returns it in
I have the following code in my Android program List<Address> addressList = geoCoder.getFromLocation(37.790551,-122.433931, 1);
I have the following code: Dim ipAdd As IPAddress = Dns.GetHostEntry(strHostname).AddressList(0) Dim strIP As
I need something like rfc822.AddressList to parse, say, the content of the TO header
I have a field with nvarchar datatype to store UNICODE value. This field is
How should I correctly store IP address list with addresses which are subnets to
I am trying to get IP address on local machine: private string GetIP() {
I use this code to get the available IPv4 addresses: static void Main(string[] args)
I have a web service on IIS and I have two network interface cards.

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.