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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:51:38+00:00 2026-05-15T18:51:38+00:00

I’m trying to build a system using jqgrid which does everything on the clientside,

  • 0

I’m trying to build a system using jqgrid which does everything on the clientside, i.e. use AJAX to retrieve a JSON object (using C#/.Net) and cache this in a javascript variable and then populate several grids from that cache (addRowData), depending on the data. That’s all working very well.

However, I’m having problems discovering how to do some of the more advanced things now.

1) paging/sorting the data with no server interaction. Is this possible? Or does it require that I write custom paging functions (i.e. when the user moves to page 2, get the next 10 records from the cache and update the grid with them). Hopefully there’s an automatic way to do this? How about sorting? Read some things that suggest its done server side but maybe they were old articles? Not sure.

2) Allow the users to see controls (mainly radio buttons and datepicker) on each row and have those changes reflected in the cache variable. I looked at the editing functions of jqGrid but this seems to be “click/edit/save”. Ideally I’d like the grid’s initial display to show, for example, one of the columns displaying pairs of radio buttons on every row and the user can just click the ones they are interested in (i.e. they don’t have to explicitly “edit” the row to see/change the radio buttons). This data is updated in the grid and, more importantly, in the cache variable driving the grid. Is there an automatic way of tying controls on each row to an underlying client dataset? How do I create the controls in each cell and relate their value to the cell value?

Hoepfully someone could point me in the right direction?

Thanks for any help you can give,

Bill

  • 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-15T18:51:39+00:00Added an answer on May 15, 2026 at 6:51 pm

    All what you want to have in the part 1 of your question can be implemented with jqGrid 3.7.x. You should use both datatype: 'json' and loadonce: true parameters. The server should send all the data back. See jqgrid setGridParam datatype:local as an example.

    What about the second part of your question. It seems to me that you try to make jqGrid too complex. I find much easier to set some controls (select/dropdown boxes, checkboxes or radio buttons) outside of the jqGrid (for example on top of the grid). If the user make changes in some of this control you should reload the grid from the server based on the new choosed parameters. See How to filter the jqGrid data NOT using the built in search/filter box as an example. If you will try to combine this way with the loadonce: true parameter you should understend, that after the first load of grid with loadonce: true the other parameter datatype: 'json' will be changed to datatype: 'local'. So to reload the grid you should additionally set datatype: 'json' every time before reloading the grid.

    UPDATED based on comments: Well. If you have some predefined data sets, you want load all from the server and then quick display the grid needed you can just define some dives and place all jqGrids (table and paging div elements) inside the corresponding additional div (one div per jqGrid). You can start loading the data to all this grids at the page loading. You makes parents divs invisible or hidden with respect of jQuery.show() and jQuery.hide() anytime when you need. Divs which should be hidden at the page start can have CSS style display:none.

    Another option to create grids dinamically with cached data is following. You can remove a jqGrid with jQuery.remove() and insert a new one <table> and paging <div> element with a method like jQuery.after(). With this way you can construct jqGrid absolutely dynamiclly. If you do so you should take in consideration, that jqGrid create some additional divs over table and paging div elements. So to delete whole jqGrid with id=”list” you should remove div with id=”gbox_list”. Alternative if you place both <table> and paging <div> in a parent div element and you can use jQuery.empty() and jQuery.html() methods on the parent div to remove or insert a new one jqGrid.

    Now about displaying of radio buttons inside of jqGrid. This is possible if you will use custom formater. See jqGrid: Editable column that always shows a select as example how to display selects (dropdown boxes) inside of jqGrid. By the way I see no advantage to use radio buttons compareing with selects. Radio buttons took only more place on the page and users will have to scroll the page friquently.

    Nevertheless I don’t recommend you to use complex elements inside of jqGrid cells. I recommend you to demonstrate to your users “Inline Editing” feature of jqGrid. It means if user select a row or make double-click on a row (you can implement one way which prefer your users) the row will be switched in the editing mode with checkboxes, select boxes (dropdown boxes), text inputs and so on. This is a standard way. It have some advantages over “form editing” from the side of users comfort. The more you go away from the standard ways the more problems you could receive in the future. To demonstrate “inline editing” you can open http://trirand.com/blog/jqgrid/jqgrid.html and choose on the tree left “Row Editing” and then “Input Types”. As a code example you can use jqGrid – edit only certain rows for an editable column.

    UPDATED 2: One more small remark. If the data on the server will be not changed friquently and you want more long time cache there on the client you can consider to use prmNames: { nd:null} parameter of jqGrid especially if you use Internet Explorer. If you do this the last HTTP GET results (inclusive jQuery.ajax requests) will be cached on the client and next ajax rwquests can load data from the local browser cache instead of sending requests to the server. If the server include any information about the allowed caching time in the response (HTTP headers) it will be automatically used on the client in jQuery.ajax.

    UPDATED 3 based on the source code posted: You have some errors in the code. Here is the fixed code

    var myGrid = $("#mygrid").jqGrid({
        datatype: 'local',
        colModel: [
            { name: 'AID', label: 'Some ID', key: true, width: 100,
              editable: false, sorttype: "int" },
            { name: 'Name', width: 300, editable: false },
            { name: 'Group', width: 100, editable: false },
            { name: 'Info', width: 100, editable: false },
            { name: 'AValue', width: 100, editable: true, edittype: 'text' }
        ],
        pager: '#mypager',
        rowNum: 10,
        rowList: [10, 20, 500],
        viewrecords: true,
        autowidth: true,
        sortname: 'AID',
        sortorder: 'desc'
    });
    myGrid.jqGrid('navGrid','#mypager',{edit:false,add:false,del:false,search:false});
    
    var mydata = [];
    for (var i = 0; i < 100; i++) {
       mydata.push({AID:i,Name:"123",Group:"456",Info:"78",AValue:"8"});
    }
    myGrid.setGridParam({data: mydata}).trigger("reloadGrid");
    

    You can try it here http://www.ok-soft-gmbh.com/jqGrid/Clientside.htm

    UPDATED 4: The same example inclusive the client side editing is here http://www.ok-soft-gmbh.com/jqGrid/ClientsideEditing.htm. It is based on the http://www.trirand.com/blog/?page_id=393/help/losing-edited-cell-data-after-paging/ and Losing edited cell data after paging.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
We're building an app, our first using Rails 3, and we're having to build
I'm trying to select an H1 element which is the second-child in its group
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.