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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:55:06+00:00 2026-06-01T02:55:06+00:00

I am using treegrid with jqGrid and am quite new to this plugin. I

  • 0

I am using treegrid with jqGrid and am quite new to this plugin. I am not able to get the treegrid feature working properly. The first time when I click the expand button it works fine. The next time, when I click to collapse, it gives me javascript error:
$t.p.data[pos] is undefined This is in the setTreeNode method of jqGrid.

I hope Oleg or someone will help or give me a pointer.

My configuration is as follows:

var grid = $("#grid").jqGrid({
    treeGrid: true,
    treeGridModel: 'adjacency',
    ExpandColumn: 'businessAreaName',
    ExpandColClick : true,
    url:'agileProgramme/records.do',
    datatype: 'json',
    mtype: 'GET',
    colNames:['Id'
              , 'Business Area'
              , 'Investment'
              , 'Org'
              , 'Goal'
    ],
    colModel:[
/*00*/          {name:'agileProgrammeId',index:'agileProgrammeId', width:0, editable:false,hidden:true},
/*01*/          {name:'businessAreaName',index:'businessAreaName', width:160, editable:false},
/*02*/          {name:'programmeName',index:'programmeName', width:150, editable:false, classes:'link'},
/*03*/          {name:'org',index:'org', width:50, editable:false, classes:'orgHierarchy', sortable : false},
/*04*/          {name:'goal',index:'goal', width:70, editable:false}
    ],
    treeReader : {
        level_field: "level",
        parent_id_field: "parent", 
        leaf_field: "leaf",
        expanded_field: "expanded"
    },
    autowidth: true,
    height: 240,
    pager: '#pager',
    sortname: 'id',
    sortorder: "asc",
    toolbar:[true,"top"],
    caption:"TableGridDemo",
    emptyrecords: "Empty records",
    loadonce: true,
    jsonReader : {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        repeatitems: false,
        cell: "cell",
        id: "agileProgrammeId"
    }
});

The data returned when the column is expanded is as below.

{
   "page":"1",
   "total":"1",
   "records":"1",
   "rows":[
      {
         "agileProgrammeId":2,
         "businessAreaName":"child",
         "programmeName":"childSomething",
         "goal":null,
         "parent":1,
         "level":"1",
         "leaf":true,
         "expanded":false
      }
   ]
}

Here is the data which is initially loaded.

{
   "page":"1",
   "total":"1",
   "records":"1",
   "rows":[
      {
         "agileProgrammeId":1,
         "businessAreaName":"parent",
         "programmeName":"parentsomething",
         "goal":null,
         "parent":null,
         "level":"0",
         "leaf":false,
         "expanded":false
      }
   ]
}
  • 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-01T02:55:07+00:00Added an answer on June 1, 2026 at 2:55 am

    I debugged the grid with the data which you posted and find out that the reason are the two lines of code where the local data are removed in case of loadonce: true.

    TreeGrid save the previous loaded data locally in the same way as loadonce: true do in case of “standard” grid. So setting of loadonce: true has no sense in case of TreeGrid. Moreover how you know now setting loadonce: true in case of TreeGrid has side effects.

    So to solve your problem you should just remove loadonce: true from the TreeGrid definition.

    UPDATED: I posted just now the suggestion to eliminate the problem which you have now in the future.

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

Sidebar

Related Questions

I am having trouble constructing a jqGrid TreeGrid using local data. This method works
I am using a jqgrid's treegrid and the data for the child nodes is
I am using jqgrid treegrid to load the data remotely on expand event. It
I'm tryoing to set up a treeGrid using jqGrid 4.2.1 after some works visual
i am using jqGrid treegrid and i want to format the back color of
using file_get_contents , I open an Internet URL and get the contents of this
Using Django, how do I generate the value of a field the first time
I am using jqGrid with treeGrid. I have added a filterToolbar. I would like
i m using this article http://blogs.msdn.com/delay/archive/2009/09/23/if-it-walks-like-a-duck-and-talks-like-a-duck-it-must-be-a-treegrid-a-simple-xaml-only-treegrid-ui-for-wpf.aspx to have hierarchical data... i am having treeview
Using TortoiseSVN against VisualSVN I delete a source file that I should not have

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.