Ticket #7559 (closed defect: fixed)
dojox.datagrid fails on IE7 when using .setStructure
| Reported by: | vlad_dojo | Owned by: | toonetown |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3 |
| Component: | DojoX Grid | Version: | 1.1.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I am getting an error in IE7 (no problem in FF3 or Safari/windows) the error is on the last line of this function in dojox.grid._View
buildRowContent: function(inRowIndex, inRowNode){
inRowNode.innerHTML = this.content.generateHtml(inRowIndex, inRowIndex);
if(this.flexCells){
// FIXME: accessing firstChild here breaks encapsulation
inRowNode.firstChild.style.width = this.contentWidth;
}
},
The 'this' is a valid object, however, it does not have contentWidth attribute
I am usuing 8/24 version of SVN trunk. I am thinking it is a bug... but not sure... because it does not error out in FF or Safari
The sample code is:
<table style="font-size:auto;" id="grid"
dojoType="dojox.grid.DataGrid" jsId="grid" rowSelector="20px"
>
<script type="dojo/method">
data = {
identifier: 'col_1',
label: 'col_1',
items: []
};
data_list = [
{ col1: "normal", col2: false, col3: "new", col4: 'But are not followed by two hexadecimal', col5: 29.91, col6: 10, col7: false },
{ col1: "important", col2: false, col3: "new", col4: 'Because a % sign always indicates', col5: 9.33, col6: -5, col7: false },
{ col1: "important", col2: false, col3: "read", col4: 'Signs can be selectively', col5: 19.34, col6: 0, col7: true },
{ col1: "note", col2: false, col3: "read", col4: 'However the reserved characters', col5: 15.63, col6: 0, col7: true },
{ col1: "normal", col2: false, col3: "replied", col4: 'It is therefore necessary', col5: 24.22, col6: 5.50, col7: true },
{ col1: "important", col2: false, col3: "replied", col4: 'To problems of corruption by', col5: 9.12, col6: -3, col7: true },
{ col1: "note", col2: false, col3: "replied", col4: 'Which would simply be awkward in', col5: 12.15, col6: -4, col7: false }
];
var rows = 4;
for(var i=0, l=data_list.length; i<rows; i++){
data.items.push(dojo.mixin({ col_1: i }, data_list[i%l]));
}
// global var "test_store"
test_store = new dojo.data.ItemFileWriteStore({data: data});
gridLayout = {
defaultCell: { width: 8, editable: true, styles: 'text-align: right;' },
cells: [
{ name: 'Id', width: 3, field: 'col_1' },
{ name: 'Priority', field: 'col1', styles: 'text-align: center;', type: dojox.grid.cells.Select, options: ["normal", "note", "important"]},
{ name: 'Mark', field: 'col2', width: 3, styles: 'text-align: center;', type: dojox.grid.cells.Bool },
{ name: 'Status', field: 'col3', styles: 'text-align: center;', type: dojox.grid.cells.Select, options: [ "new", "read", "replied" ]},
{ name: 'Message', field: 'col4', styles: '', width: '100%' },
{ name: 'Amount', field: 'col5'}
]
};
//store has to go before the layout
this.setStore(test_store);
this.setStructure(gridLayout);
</script>
</table>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.