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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:32:04+00:00 2026-05-29T11:32:04+00:00

jqGrid tree nodes are read from server using json data. Click in node reads

  • 0

jqGrid tree nodes are read from server using json data. Click in node reads child nodes from server.
Code below is used to restore opened tree node if page is loaded.
Only single node is opened always in tree.
Controller assings node ids to autoClicked array and gridComplete opens nodes using this path.
This causes grid flasinging on page load since multiple server requests buid grid multiple times.
How to disable grid flashing ?
Is it possible to prevent multiple jqGrid building and show only find jqGrid tree ?

Answer in
Send expanded TreeGrid Nodes in cookie
works for fully populated grid only.

var autoClicked=[<%= Model.Path() %>];
$(function () {
    var grid = $("#tree-grid");
    grid.jqGrid({
        gridComplete: function () {
            setTimeout(function () {
                var id = autoClicked.shift();
                var rData = grid.getGridParam('data');
                var data = null;
                for (var i = 0; i < rData.length; i++) {
                    if (id == rData[i].id) {
                        data = rData[i];
                        break;
                    }
                }

                if (data == null)
                    return;
                grid.expandRow(data);
                grid.expandNode(data);
            }, 0);

        },
        url: '<%= ResolveUrl("~/Store/GridData")%>',
        datatype: "json",
        mtype: "POST",
        height: "auto",
        loadui: "disable",
        treeGridModel: "adjacency",
        colModel: [
                { name: "id", width: 1, hidden: true, key: true },
                { name: "menu", classes: "handcursor" },
                { name: "url", width: 1, hidden: true }
            ],
        autowidth: true,
        treeGrid: true,
        ExpandColumn: "menu",
        rowNum: 200,
        ExpandColClick: true,
        onSelectRow: function (rowid) {
            var treedata = grid.jqGrid('getRowData', rowid);
            window.location = treedata.url;
        }
    }
            );
});

controller:

    public string Path()
    {
        Artomlii node = Artomliik;
        string res = node.Artomaliik.ToString();
        while (!Core.IsNullOrWhiteSpace(node.Treeparent))
        {
            // retrieve parent node
            node = MyDataContext.ExecQuery<Artomlii>(@"select * from artomlii where treeorder={0}", node.Treeparent).FirstOrDefault();
            if (node == null)
                break;
            res = node.Artomaliik.ToString() + "," + res;
        }
        return res;
    }
  • 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-29T11:32:05+00:00Added an answer on May 29, 2026 at 11:32 am

    On your place I would solve the problem in another way.

    I would send to the server in postData an additional parameter which contains the list of nodes which should be expanded.

    In the case the server will place all requested nodes in the response. The value of “expanded” hidden column can be set to true either directly in the server response or on the client side in the beforeProcessing callback in the way which I described in the answer which you referenced.

    In the way you would have exactly the same results which you need. The filling of the grid will be more quickly because of elimination of unneeded round-trips. The flashing will be removed because all the rows in the tree grid will be filled “at once” because of the usage of gridview: true which is default for Tree Grids in the current implementation of jqGrid.

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

Sidebar

Related Questions

jqgrid is used to show stock status from server. Data is retrieved in json
If jqGrid row ids (passed as separate id property from json data in server)
I am using jqGrid ( http://www.trirand.com/blog/ ) to display some read-only data. The resizeable
My jqGrid gets its JSON data from a URL. It shows every columnt right
jQgrid row is edited using inline editing mode. Pressing Enter sends data to server
I'm using JQGrid to display my data (the server returns xml). The data seems
jqGrid add forms contains autocomplete boxes using code below. If new row is added
I have a JQGRid tree. It loads data click by click, not all at
I'm using jqgrid tree grid with the following configuration colModel : [ { name:'id',width
My jqGrid that does a great job of pulling data from my database, but

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.