Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18866 closed defect (fixed)

[pr][cla] DataGrid: errors instantiating a declarative DataGrid through the Markup Factory

Reported by: gorgoroth Owned by: Evan
Priority: high Milestone: 1.11.3
Component: DojoX Grid Version: 1.11.2
Keywords: Cc:
Blocked By: Blocking:

Description

Dojox::grid::_Layout.js::addRowsDef(), uses lang.isArray() to determinate how to treat the columns definition.

When a DataGrid? is built with a declarative approach, addRowsDef() receives a single element array containing a NodeList? of the THEAD/TH nodes found by the markup factory.

Because lang.isArray() has changed the way it recognizes if the parameter is an array, now the NodeList? (inDef[0], inside addRowsDef()) is not recognized as an array: so addRowsDef() treats the parameter as a single column. This causes the grid columns structure to be corrupted with the result that the grid cannot be instantiated because _Layout.cells is not a list of cells but a single element array containing the needed array of cells inside the first element.

So, every access to the cells member to take a cell definition, will fail if the index is greater than 0 (see _Layout.js::setColunmVisibility(), for example).

Correct cells member: is an array of cells [cell, cell, cell,...]

Wrong cells member: is a single element array which contains the array of cells. cell, cell, cell,...?

Change History (7)

comment:1 Changed 3 years ago by gorgoroth

Dojox::grid::_Layout.js::addRowsDef() should use lang.isArrayLike(). Or lang.isArray() should take into account a NodeList?.

comment:2 Changed 3 years ago by dylan

dojox/grid/* is deprecated, but if you want to create a pull request per the contribution guidelines, https://github.com/dojo/dojox/blob/master/CONTRIBUTING.md , we'll review and land it.

comment:3 Changed 3 years ago by dylan

Milestone: tbd1.11.3
Priority: undecidedhigh
Summary: DataGrid: errors instantiating a declarative DataGrid through the Markup Factory[pr][cla] DataGrid: errors instantiating a declarative DataGrid through the Markup Factory

https://github.com/dojo/dojox/pull/237

Needs testing, but PR is trivial.

comment:4 Changed 3 years ago by Michael J Van Sickle

comment:5 Changed 3 years ago by Michael J Van Sickle

Resolution: duplicate
Status: newclosed

comment:6 Changed 3 years ago by Michael Van Sickle <mvansickle@…>

Resolution: duplicatefixed

In d85345a/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:7 Changed 3 years ago by Michael Van Sickle <mvansickle@…>

In c7278df/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.