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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:09:03+00:00 2026-05-27T07:09:03+00:00

The problem is loading data in jqgrid takes a lot of time, currently I

  • 0

The problem is loading data in jqgrid takes a lot of time, currently I am using

for(var i=0;i<homeFileList.length;i++)
        jQuery("#tblHomeFileList").jqGrid('addRowData',i+1,homeFileList[i]);

to load data into the grid, but since it is iterating, it is taking a lot of time, is there any way to load data faster?

I read the addRowData can even insert multiple data at once (Reading Link), i thought it might be faster, but it does not insert anything to my grid

See my below code.

var homeFileList=[];
$(xml).find('IPC').each(function(){ 
    $(this).children('homefilelist').each(function(){ 
        $(this).children('homefilelist_info').each(function(){ 
            var row={};
            isPresent=true;
            row.permission=$(this).attr('permission');
            row.hardlink=$(this).attr('hardlink');
            row.owner=$(this).attr('owner');
            row.group=$(this).attr('group');
            row.fsize=$(this).attr('fsize');
            row.month=$(this).attr('month');
            row.date=$(this).attr('date');
            row.time=$(this).attr('time');
            row.filename=$(this).attr('filename');
            homeFileList.push(row);
        });
    });
});

Update after Oleg’s comment

//HomeFileList
if(homeFileList.length>0)
{
    jQuery("#tblHomeFileList").jqGrid({
        datatype: "clientSide",
        colNames:['Permission','Hardlink','Owner','Group','Size','Month','Date','Year/Time','Filename'],
        colModel:[
            {name:'permission',index:'permission', align:"left",width:"100px"}, 
            {name:'hardlink',index:'hardlink', align:"left", width:"80px"},
            {name:'owner',index:'owner', align:"left",width:"100px"},
            {name:'group',index:'group', align:"left"},
            {name:'fsize',index:'fsize', align:"left", width:"90px"},
            {name:'month',index:'month', align:"left",width:"100px"},   
            {name:'date',index:'date', align:"left", width:"80px"},
            {name:'time',index:'time', align:"left",width:"100px"},
            {name:'filename',index:'filename', align:"left"}
        ],

                    pager : '#HomeFileListGridpager',
        rowNum:10,
        rowList:[10,50,100],
        scrollOffset:0,
        height: 'auto',
        autowidth:true,
        viewrecords: true,
        gridview: true
            });

    /*This for loop loads my data from homeFileList into grid
for(var i=0;i<homeFileList.length;i++)
        jQuery("#tblHomeFileList").jqGrid('addRowData',i+1,homeFileList[i]);*/

    alert($.isArray(homeFileList)); //returns true


    jQuery("#tblHomeFileList").jqGrid('addRowData',homeFileList);


    jQuery("#tblHomeFileList").setGridParam({rowNum:10}).trigger("reloadGrid");
}
else
    gridUnavailable("#tblHomeFileList");

XML response (I have cut short the xml below, as it is huge data inside homefilelist)

<?xml-stylesheet type="text/xsl" href="client9.xsl"?><client version="1.0"><IPC>
<homefilelist>
    <homefilelist_info permission='-rwxr-xr-x' hardlink='1' owner='asimon' group='support' fsize='61597' month='Mar' date='22' time='2011' filename='libpmwspsvrcmn.so' />
    <homefilelist_info permission='-rwxr-xr-x' hardlink='1' owner='asimon' group='support' fsize='21778' month='Mar' date='22' time='2011' filename='libpmorablk.so' />
    <homefilelist_info permission='-rwxr-xr-x' hardlink='1' owner='asimon' group='support' fsize='36226' month='Mar' date='22' time='2011' filename='libpmjvm.so' />
</homefilelist>
</IPC>
</client>
  • 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-27T07:09:04+00:00Added an answer on May 27, 2026 at 7:09 am

    You can use data parameter of jqGrid:

    $("#tblHomeFileList").jqGrid({
        datatype: "local",
        data: homeFileList,
        ...
    });
    

    See the demo. In the case the whole data of the grid will be placed in the grid and the first page will be paint. I am sure that you will see the difference in the performance for large number of rows immediately.

    I recommend you additionally include formatter and sorttype attributes in the grid. For example the definition of 'fsize' which hold integer data can be the following:

    {name: 'fsize', index: 'fsize', width: 90, formatter: 'integer', sorttype: 'int'}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working with jQuery and PHP a problem occurs with loading new data from
I'm using Backbone along with jQuery and jqGrid and encountering problem with binding the
I've got a bit of a problem with making my data loading and filtering
The problem: Loading an excel spreadsheet template. Using the Save command with a different
I have have a problem loading and accessing data from a value object in
I am loading data for tests in tables using xml and ndbunit.But,for a table
I'm having trouble loading the mysql data to the option box using php. Here's
I'm having a problem loading my xml file using simplexml_load_file(), would really appreciate some
I am having problem loading data into Nested datagrid. When the user clicks on
Hey i recently started android development and encountered a problem when saving/loading data from

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.