PDA

View Full Version : IE8 issue



frankbolviken
24 Oct 2011, 4:12 AM
Hi, we have the following model:



Ext.define('app.model.Folder', {
extend: 'Ext.data.Model',
fields: [
{ name: 'name', type: 'string' },
'displayName',
'title',
'description',
'nodeType',
{ name: 'id', mapping: 'path'},
{ name: 'nodeRef', type: 'string'},
{ name: 'items', type: 'auto'},
{ name: 'path', type: 'string'},
{ name: 'cls', mapping: 'cls'},
'iconCls',
{ name: 'deletePermission', type: 'boolean', mapping: 'userAccess.delete'},
{ name: 'createDocumentPermission', type: 'boolean', mapping: 'userAccess.createDocument'},
{ name: 'createFolderPermission', type: 'boolean', mapping: 'userAccess.createFolder'},
{ name: 'editPermission', type: 'boolean', mapping: 'userAccess.edit'},
{ name: 'movePermission', type: 'boolean', mapping: 'userAccess.move'}
]
});


If we try to open the app with IE8, we get "ERROR ON PAGE".

Webpage error details


User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C)
Timestamp: Mon, 24 Oct 2011 12:10:15 UTC




Message: Expected identifier
Line: 397
Char: 13
Code: 0
URI: http://localhost:9090/darwin-web/ext-all-debug.js




Message: Expected identifier
Line: 397
Char: 13
Code: 0
URI: http://localhost:9090/darwin-web/ext-all-debug.js


If we uncomment the deletePermission from the model, the page loads fine. So, IE8 is in some way reacting to the model containing the string "delete". Seriously? Are there any way of avoding this? (Yes, i've tried to calling the permission something else, and mapping to the delete variable in json. The json is provided, and we cannot change it, so thats not a option right now.

Frank

skirtle
24 Oct 2011, 9:05 AM
You can't use delete as an unquoted property like that. Same for many other keywords. Try:


mapping: 'userAccess["delete"]'

frankbolviken
25 Oct 2011, 2:49 AM
Thank you for your reply! It works like a little puppy in a room full of footballs.