Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rows disappearing from dgrid tree #862

Closed
aothms opened this issue Mar 5, 2014 · 1 comment
Closed

Rows disappearing from dgrid tree #862

aothms opened this issue Mar 5, 2014 · 1 comment

Comments

@aothms
Copy link

aothms commented Mar 5, 2014

As requested by Kenneth in #714, a short snippet illustrating issues we have been seeing with rows disappearing from a tree grid after a store notify.

I can't tell whether this is a dup of #714 so I'll leave it up to you to decide. Problem encountered with dgrid v0.3.13 and dojo 1.9.3. dgrid v0.3.11 does not seem to have this issue.

Thanks in advance,
Thomas

<!doctype html>
<html>
<head>
    <title>dgrid test</title>
    <meta charset="utf-8" />
    <script type="text/javascript" src="./dojo/dojo.js"
        data-dojo-config="async: true"></script>
    <script type="text/javascript">
        require(["dojo/store/Memory", "dojo/store/Observable", "dgrid/OnDemandGrid", "dgrid/tree", 
                 "dojo/query", "dojo/domReady!"], function(Store, Observable, Grid, tree, query) {
            var columns = [
                tree({label: "Id", field: "id"}),
                {label: "Value", field: "value"}
            ];
            var store = new Observable(new Store({ data: [
                { id: 'a', value: "Hello", parent: null },
                { id: 'b', value: "World", parent: 'a'  },
                { id: 'c', value: "!"    , parent: 'a'  }
            ]})); 
            store.getChildren = function(parent, options) {
                return this.query({parent:parent.id});
            };
            var grid = new Grid({
                columns: columns,
                store: store,
                sort: [{attribute: "id", descending: true}],
                query: {parent: null}
            }, "grid");
            query(".dgrid-expando-icon").on('click', function() {
                setTimeout(function() {
                    store.notify({ id: 'b', value: "Goodbye", parent: 'a' }, 'b');
                }, 100);
            });
        });
    </script>
</head>
<body>
    <div id="grid"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants