PDA

View Full Version : [CLOSED] Internet Explorer 8 and Extjs 4.2.0



florian-network
23 Apr 2013, 8:45 AM
Hi,

I've discovered a bug due to a bad interpretation of Internet Explorer 8.
In the method hasLockedColumns onb line 101630 in extjs-all-debug.js.

len = columns.length

IE8 return one more like IE9 because it count the [prototype] key.
So if you have 8 elements in columns IE8 return 9.
And when you tried to access to columns[8] it return undefined so the next line :

if (!column.processed && column.locked)

make an error.

To solve it, replace this code :
hasLockedColumns: function(columns) {
var i,
len = columns.length,
column;


for (i = 0; i < len; i++) {
column = columns[i];
if (!column.processed && column.locked) {
return true;
}
}
},
By this code :
hasLockedColumns: function(columns) {
var i,
len = columns.length,
column;


for (i = 0; i < len; i++) {
column = columns[i];
if (column != undefined) {
if (!column.processed && column.locked) {
return true;
}
}
}
},

It's possible that this problem appear in another function in extjs but i haven't test all.

slemmon
23 Apr 2013, 10:14 AM
I don't believe I'm seeing what you're describing. Below is my test case. If I've misunderstood please provide a test case that demonstrates what you're seeing.



Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone', 'four', 'five', 'six', 'seven', 'eight'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' },
{ text: 'Four', dataIndex: 'four' },
{ text: 'Five', dataIndex: 'five' },
{ text: 'Six', dataIndex: 'six' },
{ text: 'Seven', dataIndex: 'seven' },
{ text: 'Eight', dataIndex: 'eight' }
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});

n_milushev@applss.com
16 Sep 2013, 5:07 AM
I think it's a question of trailing comma.I don't know who's fault is it though?! Developer, browser or library. May be it is written in the Javascript standards.


Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone', 'four', 'five', 'six', 'seven', 'eight'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254", 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8 }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});




Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' },
{ text: 'Four', dataIndex: 'four' },
{ text: 'Five', dataIndex: 'five' },
{ text: 'Six', dataIndex: 'six' },
{ text: 'Seven', dataIndex: 'seven' },
{ text: 'Eight', dataIndex: 'eight' }, //with this comma IE8 stops working. Other browsers forgive.
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});

mankz
16 Sep 2013, 9:48 PM
Developer fault. Don't use trailing commas and all is well :)

lucarossi
22 Oct 2013, 7:36 AM
I have the same problem with Extjs4.2.2 an i resolve with this workaround thanks for posting.