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 718511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:32:06+00:00 2026-05-14T05:32:06+00:00

everything is working fine with my jqgrid except a small issue. i have defined

  • 0

everything is working fine with my jqgrid except a small issue. i have defined postData below:

 $(document).ready(function() {

$("#ctl00_ContentPlaceHolder2_drpUSite").change(function() {
    site = ($("#ctl00_ContentPlaceHolder2_drpUSite").val());
    loadusergrid();
});
var usrparams = new Object();
var site = ($("#ctl00_ContentPlaceHolder2_drpUSite").val());
//----grid code---------
$("#users").jqGrid({
    prmNames: {
        _search: "isSearch",
        nd: null,
        rows: "numRows",
        page: "page",
        sort: "sortField",
        order: "sortOrder"
    },
    // add by default to avoid webmethod parameter conflicts
    postData: { searchString: '', searchField: '', searchOper: '', sites: site },
    datatype: function(postdata) {
        mtype: "GET",
        $.ajax({
            url: 'Users.aspx/GetUsers',
            type: "POST",
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(postdata),
            dataType: "json",
            success: function(data, st) {
                if (st == "success") {
                    var grid = $("#users")[0];
                    var m = JSON.parse(data.d);
                    grid.addJSONData(m);
                }
            },
            error: function() {
                alert("Loading Failed!");
            }
        });
    },
    // this is what jqGrid is looking for in json callback
    jsonReader: {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        cell: "cell",
        id: "login",
        repeatitems: true
    },
    colNames: ['Login', 'First Name', 'Last Name', 'Email', 'Site', 'Role', 'Room', 'UnitID', 'Supervisor', 'Super'],
    colModel: [
    { name: 'login', index: 'login', width: 20 },
    { name: 'fname', index: 'fname', width: 20, hidden: true },
    { name: 'lname', index: 'lname', width: 60, align: "center", sortable: true, searchoptions: { sopt: ['eq', 'ne']} },
    { name: 'email', index: 'email', width: 20, align: "center", sortable: false },
    { name: 'site', index: 'site', width: 50, align: "center", sortable: true, searchoptions: { sopt: ['eq', 'ne']} },
    { name: 'role', index: 'role', width: 15, align: "center", sortable: true, searchoptions: { sopt: ['eq', 'ne']} },
    { name: 'room', index: 'room', width: 30, align: "center", sortable: true },
    { name: 'unitid', index: 'unitid', width: 10, align: "center", sortable: false },
    { name: 'super', index: 'super', width: 20 },

    { name: 'supername', index: 'supername', width: 10, align: "center", sortable: false },
],

    pager: "#pageusers",
    viewrecords: true,
    caption: "Registered Users",
    imgpath: 'themes/steel/images',
    rowNum: 20,
    rowList: [10, 20, 30, 40, 50],
    sortname: "pname",
    sortorder: "desc",
    showpage: true,
    gridModel: true, gridToolbar: true,
    onSelectRow: function(id) {
        var ret = jQuery("#users").getRowData(id);
        accpara.id = ret.id;
        accpara.pname = ret.pname;
        accpara.pid = ret.pid;
        accpara.bld = ret.bld;
        accpara.cname = ret.cname;
        accpara.amt = ret.amt;
        accpara.status = ret.status;
        accpara.notes = ret.notes;
        accpara.lname = ret.lname;
    }
});
jQuery("#users").navGrid('#pageusers', { view: false, del: false, add: false, edit: false },
 {}, // default settings for edit
 {}, // default settings for add
 {}, // delete
 {closeOnEscape: true, multipleSearch: true,
 closeAfterSearch: true
 }, // search options
 {}
 );
$("#users").setGridWidth(1300, true);
$("#users").setGridHeight(500, true);
jQuery("#users").jqGrid('filterToolbar');
//----grid code ends here



   function loadusergrid() {
       $("#users").setGridParam({ page: 1 }, { pgbuttons: true }, { pginput: true }, { postData: { "site": site} }).trigger("reloadGrid");
    }
});

when page loads for the 1st time, this works..

now i have 4 drop-downs which filter users. i have written a function which reloads the grid when the dropdown is changed, but it isnt working.. what am i doing wrong here?? when i enable postback for the dropdowns, i get the filtered result. i want to avoid postbacks on my page :). right now i have added just the site dropdown as the filter. once this starts working ill add the remaining 3.

firebug shows the ajax call is fired successfully but with an empty sitename. please note that the site dropdown cntains an empty value when page is loaded for the 1st time.

thanks in advance

  • 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-05-14T05:32:07+00:00Added an answer on May 14, 2026 at 5:32 am

    $("#mygrid").setPostData({parameters}); does the trick

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

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should \usepackage{longtable}. PDF Documentation of the package: ftp://ftp.tex.ac.uk/tex-archive/macros/latex/required/tools/longtable.pdf Tutorial… May 14, 2026 at 11:24 pm
  • Editorial Team
    Editorial Team added an answer Modern CPUs will do float + and - in a… May 14, 2026 at 11:24 pm
  • Editorial Team
    Editorial Team added an answer If you use gcc you can do gcc -O2 -S… May 14, 2026 at 11:24 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.