Opened 11 years ago

Closed 10 years ago

#11957 closed defect (duplicate)

dojox.grid._Grid: hidden attribute cannot be set to true on columns when instantiated via HTML in HTML5

Reported by: Kenneth G. Franqueiro Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.5
Keywords: grid html5 Cc:
Blocked By: Blocking:


(Unearthed on IRC by cedrichurst, investigated/pinpointed and patch suggested by dmachi)

The dojox.grid classes (_Grid and anything that extends from it) support the notion of a hidden grid column, which is suppressed from being displayed. When instantiating a grid declaratively via HTML, this attribute can be set by including hidden="true" in the th representing the column.

However, in some HTML5-supporting browsers, the logic that picks up whether the hidden attribute is set fails, because these browsers report this attribute as a boolean rather than a string, due to the existence of an actual boolean hidden attribute in HTML5.

The faulty logic in question is currently on line 1348 of _Grid.js in trunk as of this writing:

cell.hidden = d.attr(th, "hidden") == "true";

This will fail since true == "true" returns false.

Dustin Machi proposed the following fix:

cell.hidden = d.attr(th, "hidden") != "false";

This seems to work. I'm attaching the fix plus a test page as a patch on top of dojox/grid.

I've observed the issue in Firefox 4 beta and Chrome (at least 6, unsure how far back it'd go). Interestingly, IE9 platform preview (tried 5 and 7) doesn't seem to treat this attribute specially, so it's currently okay (though this kind of means it's not up to spec).

Attachments (1)

11957.patch (1.6 KB) - added by Kenneth G. Franqueiro 11 years ago.
Patch with fix suggested by dmachi, plus test page.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Kenneth G. Franqueiro

Attachment: 11957.patch added

Patch with fix suggested by dmachi, plus test page.

comment:1 Changed 11 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:2 Changed 10 years ago by Bryan Forbes

Status: newassigned

comment:3 Changed 10 years ago by Kenneth G. Franqueiro

Resolution: duplicate
Status: assignedclosed

Looks like this was already entered and fixed as #11740.

Note: See TracTickets for help on using tickets.