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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:59:18+00:00 2026-06-14T16:59:18+00:00

I have a dgrid, working with tree column plugin. Every time that the user

  • 0

I have a dgrid, working with tree column plugin. Every time that the user click on the tree, I call the server, catch the subrows(json) and bind it. But when it happens, these subrows are show in wrong position, like the image bellow. The most strange is when I change the pagination, after go back to first page, the subrows stay on the correct place.

(please, tell me if is possible to understand my english, then I can try to improve the text)

dgrid with wrong position subrows

My dgrid code:

  var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, Pagination]);

    var grid = new CustomGrid({
        columns: [
            selector({label: "#", disabled: function(object){ return object.type == 'DOCx'; }}, "radio"),
            {label:'Id', field:'id', sortable: false},
            tree({label: "Title", field:"title", sortable: true, indentWidth:20, allowDuplicates:true}),
            //{label:'Title', field:'title', sortable: false},
            {label:'Count', field:'count', sortable: false}
        ],
        store: this.memoryStore,
        collapseOnRefresh:true,
        pagingLinks: false,
        pagingTextBox: true,
        firstLastArrows: true,
        pageSizeOptions: [10, 15, 25],
        selectionMode: "single", // for Selection; only select a single row at a time
        cellNavigation: false // for Keyboard; allow only row-level keyboard navigation
    }, "grid");

My memory store:

loadMemoryStore: function(items){

            this.memoryStore = Observable(new Memory({
                data: items,
                getChildren: function(parent, options){
                    return this.query({parent: parent.id}, options);
                },
                mayHaveChildren: function(parent){
                    return (parent.count != 0) && (parent.type != 'DOC');
                }

            }));

        },

This moment I am binding the subrows:

        success: function(data){

            for(var i=0; i<data.report.length; i++){
                this.memoryStore.put({id:data.report[i].id, title:data.report[i].created, type:'DOC', parent:this.designId});
            }

        },

I was thinking, maybe every moment that I bind the subrows, I could do like a refresh on the grid, maybe works. I think that the pagination does the same thing.

Thanks.

edit:

I forgot the question. Well, How can I correct this bug? If The refresh in dgrid works. How can I do it? Other thing that I was thinking, maybe my getChildren is wrong, but I could not identify it.

thanks again.

  • 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-14T16:59:20+00:00Added an answer on June 14, 2026 at 4:59 pm

    My solution was change from PARENT hierarquia to CHILDREN hierarquia. Now works fine.

    My dgrid code:

    this.mapReportItems(reportDAO.get()); 
                //this.mapReportItems(x); 
                this.loadMemoryStore(this.reportItems); 
    
                var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, Pagination]); 
    
                var grid = new CustomGrid({ 
                    columns: [ 
                        selector({label: "#", disabled: function(object){ return object.type == 'DOCx'; }}, "radio"), 
                        {label:'Id', field:'id', sortable: false}, 
                        tree({label: "Title", field:"title", sortable: false, indentWidth:20, shouldExpand:function() { return 0; }}), 
                        //{label:'Title', field:'title', sortable: false}, 
                        {label:'Count', field:'count', sortable: true} 
                    ], 
                    query: {parent: parent.children }, 
                    store: this.memoryStore, 
                    deselectOnRefresh: false, 
                    //columnReordering:true, 
                    collapseOnRefresh:false, 
                    pagingLinks: false, 
                    pagingTextBox: true, 
                    firstLastArrows: true, 
                    pageSizeOptions: [10, 15, 25], 
                    selectionMode: "single", // for Selection; only select a single row at a time 
                    cellNavigation: false // for Keyboard; allow only row-level keyboard navigation 
                }, "grid"); 
    

    My memory store:

    this.memoryStore = Observable(new Memory({
    data: items,
    getChildren: function(parent){

                return parent.children; 
            }, 
    
            mayHaveChildren: function(parent){ 
                //return (parent.count != 0) && (parent.type != 'DOC'); 
                return (parent.children && parent.children.length) || (parent.count != 0 && parent.type != 'DOC'); 
            } 
    
        }));
    

    This moment I am binding the subrows:

    success: function(data){ 
    
                        var node = this.memoryStore.get(this.designId); 
    
                        for(var i=0; i<data.report.length; i++){ 
                            node.children.push({id:data.report[i].id, title:data.report[i].created, type:'DOC'}); 
                        } 
    
                        this.memoryStore.put(node); 
                        this.data = data; 
                    }, 
    

    Extra information. In my case I need map my Json data, this way:

       this.reportItems = dojo.map(jsondata.reportDesign, function(report) {
                    return {
                        //'@uri': report[1],
                        id : report.id,
                        title : report.title,
                        count : report.count,
                        children: [],//report.children,
                        type : report.type
                        //parent : report.parent
                    };
                });
    

    This link was useful for me:
    https://github.com/SitePen/dgrid/issues/346

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

Sidebar

Related Questions

have written this little class, which generates a UUID every time an object of
I have a Delphi 2007 DBGrid that I'd like to allow the user to
I have a dgrid like following code, my second field is a Tree, I
Hi i have a DBGrid with an AdoTable dataset, my column headings include Job
I have a DBGrid that shows a filtered view of a dBASE table. DBGrid
I have a Delphi 2010 ADO program that has a DBGrid. Its dataset selects
I have a WPF Dev Express DxGrid that is bound to an ObservableCollection in
I have the following GridView <asp:GridView ID=grdImoveis runat=server DataSourceID=dsGrid> <Columns> <asp:BoundField HeaderText=Nome DataField=NomeCompleto />
I have a situation where I have to allow the user to update either
I currently have the following XAML for my Grid control: <dxg:GridControl x:Name=DXGrid> <dxg:GridControl.Columns> <dxg:Column

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.