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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:56:33+00:00 2026-06-06T14:56:33+00:00

I am planning generate custom XML of the entire grid data for which i

  • 0

I am planning generate custom XML of the entire grid data for which i need to traverse through each row , and each cell of the grid.

It is easy to traverse through rows as follow. The only problem i am facing is traversing through the cells as getRowData returns key value pair instead of an array.

var ids = jQuery("#jgrid").jqGrid('getDataIDs');
//traverse the rows
for (var i = 0; i < ids.length; i++) {
    var rowdata = $("#jgrid").getRowData(ids[i]);
    var res = "";
    // Traverse the cells which does not work
    for (var j = 0; j < rowdata.length; j++) {
        ...
        ....logic to generate Xml element for each cell
    }
}

I dont want to hardcode column names as i plan to use it for all the grids. So the solution has to be Generic.

Any ideas ?
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-06-06T14:56:34+00:00Added an answer on June 6, 2026 at 2:56 pm

    One of the simplest way to enumerate all data in the grid you can implement using rows and cells. It’s important to understand, that jqGrid use HTML <table> for represent the data of the grid and <tr> represent the rows. jQuery objects are wrapper on DOM elements. For example jQuery("#jgrid")[0] is the DOM element which implements HTMLTableElement. DOM is supported by really all web browsers, so you can safe use it. Internally jqGrid uses HTMLTableElement, HTMLTableRowElement and HTMLTableCellElement really permanently. If you examine the source code of getDataIDs and getRowData which you use in your current code you will see that jqGrid uses rows DOM property of the <table> intensively.

    In the asnwer and in another one you will find an example of the code which enumerate the grid data.

    In general the enumeration consists from

    var $grid = jQuery("#jgrid"), rows = $grid[0].rows, cRows = rows.length,
        iRow, rowId, row, cellsOfRow;
    
    for (iRow = 0; iRow < cRows; iRow++) {
        row = rows[iRow];
        if ($(row).hasClass("jqgrow")) {
            cellsOfRow = row.cells;
            // row represent the row with cellsOfRow.length cells.
            // So one can use for loop with iCol between 0 and cellsOfRow.length
            // cellsOfRow[iCol] represent the cell with the index iCol
            // and $(cellsOfRow[iCol]).text() - the text of the cell
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm planning to generate a huge amount of data, which I'd like to store
I created some scripts which generate the data at intervals. Say, for each hour
I planning on reading profile data from a xml file in JSP. Now i
I am planning to allow users to generate .POT files/.PO files through a PHP
I'm planning a web application that requires a lot of XML processing: generate XML
Let's say you are planning to design a hash function which will generate keys
We are planning to use Spring Roo to generate GWT artifacts, would it be
I'm planning to do a C++ standalone desktop application which uses web / html
I am working on a module at this moment using which we are planning
I'm planning to write a code generator to generate UI (forms, grids, etc.). Since

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.