Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8845 closed defect (fixed)

[PATHC][CCLA] <th> generation keeps adding extra dndType="gridColumn_<something>" attributes

Reported by: Jared Jurkiewicz Owned by: Bryan Forbes
Priority: high Milestone: 1.3
Component: DojoX Grid Version: 1.3.0b2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Jared Jurkiewicz)

<th> generation keeps adding extra dndType="gridColumn_<something>" attributes

I found another bug while investigating #8807 that turns out to be a bug in cell generation.

in: dojox/grid/_Builder.js

Function:

generateHtml

You do the following check:

if(cell.attrs){

if(cell.attrs.indexOf("dndType='gridColumn'") == -1){

cell.attrs += " dndType='gridColumn_" + this.grid.id + "'";

}

}else{

cell.attrs = "dndType='gridColumn_" + this.grid.id + "'";

}

The problem is ... that cells.attrs.indexOf ALWAYS returns -1. This is because you're looking for the index of:

dndType='gridColumn'

Which never appears in that string because you generate it as: dndType='gridColumn_<gridid>'

This causes it (each time it regens the header, for example, to add another dndType=gridColumn_<gridid> into thew HTML. So you end up with markup like:

<th dndType=gridColumn_<gridid> dndType=gridColumn_<gridid> dndType=gridColumn_<gridid> dndType=gridColumn_<gridid> dndType=gridColumn_<gridid> dndType=gridColumn_<gridid> dndType=gridColumn_<gridid> ... rest of atts></th>

You need to alter the indexOfCheck to be: if(cell.attrs.indexOf("dndType='gridColumn_") == -1){

And then it won't keep inserting the same attribute over and over.

Attachments (1)

ecessiveAttrs.patch (464 bytes) - added by Jared Jurkiewicz 11 years ago.
Patch for redundant/excessive setting of an attr when rendering.

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Jared Jurkiewicz

Attachment: ecessiveAttrs.patch added

Patch for redundant/excessive setting of an attr when rendering.

comment:1 Changed 11 years ago by Jared Jurkiewicz

Summary: <th> generation keeps adding extra dndType="gridColumn_<something>" attributes[PATHC][CCLA] <th> generation keeps adding extra dndType="gridColumn_<something>" attributes

comment:2 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [16982]) Fixing excessive setting of dndType. \!strict fixes #8845

comment:3 Changed 11 years ago by Jared Jurkiewicz

Description: modified (diff)

comment:4 Changed 11 years ago by Adam Peller

Milestone: tbd1.3
Note: See TracTickets for help on using tickets.