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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:55:34+00:00 2026-06-16T04:55:34+00:00

I create a local object collection based on the user’s selection. The dynamic Array

  • 0

I create a local object collection based on the user’s selection. The dynamic Array should be loaded to the jqGrid. After dynamically creating the array I tried to reload, but nothing happens. Here is the code –

$(document).ready(function () {

         var arrobj = [];           

         var JSONString = []; //[{"DOId":"0","DONo":"Please select","DealerCode":"0","Week":"0","Item":"0","Qty":"11","Date":"11"}]

         $("#<%=btnAdd.ClientID%>").click(function () {
             //Get values
             //Date
             var dlDt = $("#<%=tbRchngDt.ClientID%>").val();
             //Qty
             var dlQty = $("#<%=tbQty.ClientID%>").val();
             //item
             var dlItem = $("#<%=ddlItem.ClientID%>").val();
             //DO No
             var dlDOId = $("#<%=ddlDO.ClientID%>").val();
             var dlDO = $("#<%=ddlDO.ClientID%> option:selected").text();
             //Week
             var dlWeek = $("#<%=ddlWeek.ClientID%>").val();
             //Dealer
             var dlDealer = $("#<%=ddlDealer.ClientID%>").val();

             DistributionDtl = new Object();
             DistributionDtl.DOId = dlDOId;
             DistributionDtl.DONo = dlDO;
             DistributionDtl.DealerCode = dlDealer;
             DistributionDtl.Week = dlWeek;
             DistributionDtl.Item = dlItem;
             DistributionDtl.Qty = dlQty;
             DistributionDtl.Date = dlDt;


             //alert(DistributionDtl);
             arrobj.push(DistributionDtl);
             JSONString = JSON.stringify(arrobj);
             //alert(JSONString);
             $("#list").jqGrid('setGridParam',
             { datatype: "local",
                 data: JSONString
             }).trigger("reloadGrid");

         });
         jQuery("#list").jqGrid({ data: JSONString,
             datatype: "local",
             height: 150,
             width: 600,
             rowNum: 10,
             rowList: [10, 20, 30],
             colNames: ['DOID', 'Item', 'Qty', 'Date'],
             colModel: [{ name: 'DOId', index: 'DOId', width: 60, sorttype: "int" },
                                { name: 'Item', index: 'Item', width: 120 },
                                 { name: 'Qty', index: 'Qty', width: 80 },
                                  { name: 'Date', index: 'Date', width: 120}],
             pager: "#pager",
             viewrecords: true,
             caption: "Contacts"
         });

     });
  • 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-16T04:55:37+00:00Added an answer on June 16, 2026 at 4:55 am

    You should add data local to jqgrid with any of the following methods:

    • addJSONData – with data as json
    • addRowData – adding row by row and then trigger reload grid to recalculate pagination – data should be a javascript object

    Documentation can be found here. Edit: According to the documentation you CAN set local data directly in the “data” param but it should be an array not a json string and you do not have the contents of JSONString in your question, so the problem might come from that.

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

Sidebar

Related Questions

I'm trying to run the following PowerShell script to create a local user. This
I'm trying to write a custom powershell script that will create a local user
How can I shift timezone of Date object created in local timezone to target
I'm trying to create a local branch that tracks a remote branch. Here's what
I have been playing around with GC.GetTotalMemory(). When I create a local variable of
Related: How do I create a static local variable in Java? Pardon if this
I want to learn how to create a simple local server in ruby like
I've create a web site on my local IIS 7 with my own ASP.Net
I need to create directories in the local machine, can i do this with
I am trying to create custom templated control based on a ListBox to display

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.