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

CompoundColumns with sort property causes an error #901

Closed
jongeuncha opened this issue Apr 21, 2014 · 0 comments
Closed

CompoundColumns with sort property causes an error #901

jongeuncha opened this issue Apr 21, 2014 · 0 comments

Comments

@jongeuncha
Copy link

Tested on dgrid version, 0.3.14

In https://github.com/SitePen/dgrid/blob/master/test/extensions/CompoundColumns.html,
on line 260, change sort: "id" to sort: "col1" in order to initially sort the grid by "col1".

window.grid = new (declare([Grid, Selection, Keyboard, CompoundColumns]))({
                        sort: "id",
                        store: testStore,
                        columns: getColumns()
                    }, "grid");

View this test page and there is an error stating,
Error on domReady callback: TypeError: Cannot read property 'nodeType' of null

By examining Call Stack, target on line 357 in Grid.js points to the hidden header that does not have text node as a child.

if(target){
                target = target.contents || target;
                // place sort arrow under clicked node, and add up/down sort class
                this._lastSortedArrow = put(target.firstChild, "-div.dgrid-sort-arrow.ui-icon[role=presentation]");
                this._lastSortedArrow.innerHTML = " ";
                put(target, desc ? ".dgrid-sort-down" : ".dgrid-sort-up");
                // call resize in case relocation of sort arrow caused any height changes
                this.resize();
            }
treasonx pushed a commit to treasonx/dgrid that referenced this issue Apr 29, 2014
Make sure that the target has contents or children before placing sort
arrow UI.

When trying to set the column sort arrow UI on a hidden column header we
were making the assumption that the column header had children. But if
the header was hidden it would cause an exception when trying to place
the UI element.
@ghost ghost closed this as completed in c78ba8b May 8, 2014
This issue was closed.
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

Successfully merging a pull request may close this issue.

1 participant