#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 )
<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)
Change History (5)
Changed 12 years ago by
Attachment: | ecessiveAttrs.patch added |
---|
comment:1 Changed 12 years ago by
Summary: | <th> generation keeps adding extra dndType="gridColumn_<something>" attributes → [PATHC][CCLA] <th> generation keeps adding extra dndType="gridColumn_<something>" attributes |
---|
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|
Patch for redundant/excessive setting of an attr when rendering.