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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:05:30+00:00 2026-05-14T02:05:30+00:00

I am having trouble constructing a jqGrid TreeGrid using local data. This method works

  • 0

I am having trouble constructing a jqGrid TreeGrid using local data. This method works just fine as a regular grid if you comment out the treeGrid and ExpandColumn attributes, but once you add those to try to make it a tree grid, it doesn’t create a tree grid (it just creates a “normal” grid), and it no longer sorts properly.

I ensured that I downloaded the proper TreeGrid files during the jqGrid download.

jQuery(function(){

  var gridOptions = {
    datatype: "local",
    height: 250,
    colNames: ['Name', 'Type', 'Last Modified On', 'Last Modified By'],
    colModel: [{name: 'name', index: 'name', width: 200, sorttype: 'text'},
           {name: 'type', index: 'type', width: 200, sorttype: 'text'},
           {name: 'modifiedon', index: 'modifiedon', width: 200, sorttype: 'date'},
           {name: 'modifiedby', index: 'modifiedby', width: 200, sorttype: 'text'}],
    treeGrid: true,
    ExpandColumn: 'name',
    caption: "My Grid"
};

    jQuery("#treeGrid").jqGrid(gridOptions);

var gridData = [
    {name: "My File", type: "My File Type", modifiedon: "03/10/2010", modifiedby"Strong Sad", lft: "1", rgt: "8", level: "0"},
    {name: "One of Everything", type: "Word Document", modifiedon: "02/12/2009", modifiedby: "Strong Bad", lft: "2", rgt: "5", level: "0"},
    {name: "My Presentation", type: "PowerPoint", modifiedon: "01/23/2009", modifiedby: "The Cheat", lft: "3", rgt: "4", level: "0"}
];

for (var i = 0; i < gridData.length; i++) {
    jQuery("#treeGrid").jqGrid('addRowData', i + 1, gridData[i]);
}

});
  • 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-14T02:05:30+00:00Added an answer on May 14, 2026 at 2:05 am

    There are also other warnings in the TreeGrid documentation and most of them seem to apply to what you try to do.

    • Currently adding nodes with addRowData is not supported.
    • Adding nodes is currently not supported.
    • Currently jqGrid can work only with data returned from server.

    It seems all of these three warnings apply to you. You use addRowData you try to add nodes to an “empty” Tree and you try to use local data instead of “data returned from server”.

    So I advise you to construct your sample to match the Treegrid real world example (can be found on the left side under “New in version 3.5”)


    The documentation for TreeGrid you linked to states:

    In order to use this module you should
    mark the Treegrid when you download
    the grid. For more information refer
    to Download. For Developers – this is
    the grid.treegrid.js in the src
    directory.

    Did you do this? Are the relevant js-files for TreeGrid included in your js-files for jqGrid?

    A quick copy/paste of your code on jsbin works for me

    http://jsbin.com/afuza/edit (then hit the preview button)

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

Sidebar

Related Questions

I'm having a little trouble constructing the regular expression using java. The constraint is,
I'm having trouble constructing an efficient query in EF4 using type per table (TPT)
Having trouble with an .htaccess file on WAMP. Works on the live server, but
Having trouble framing this assertion in Rspec for my rails app. A User has
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that
I am having trouble with an assignment. I have a class called Grid and
I'm having some trouble using multiple constructors in java. what I want to do
Having trouble getting this syntax right: SELECT DISTINCT id FROM metadata WHERE (meta_key =
Having trouble with this -- a couple of other related posts out there, but
I am having trouble constructing a unusual lookup formula in Excel. Normally, I would

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.