PDA

View Full Version : Got got some errors about cross-platform in IE and Opera.



Allan Stark
2 Aug 2012, 12:50 AM
Got got some errors about cross-platform in IE and Opera.

In IE 9 (32bit, 9.0.8112.16421): an error "Unable to get value of the property 'split': object is null or undefined..." (Controller.js?_dc=1343896993844, line 335 character 13).

In Opera - tree grid does not display items (and many projected errors in ext-all.css).

In FireFox 14.0.1 and Google Chrome 20.0.1132.57m all works fine.

In all browsers exept Opera - problem with the positioning cert's image (starts working correctly after browser's window resizing).

Application:

37693

app.js:

Ext.application({
name: 'ECS2',
appFolder: 'app',
launch: function () {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [
{
xtype: 'box',
region: 'north',
height: 30
},{
xtype: 'view_invoices_list',
region: 'west',
width: 450
},{
xtype: 'view_certs_preview_area',
region: 'center'
}]
});
},
controllers: ['controller_invoices', 'controller_certs_preview']
});


controller_certs_preview.js

Ext.define('ECS2.controller.controller_certs_preview', {
extend: 'Ext.app.Controller',
views: 'view_certs_preview_area',
init: function () {
this.control({
'viewport > view_certs_preview_area': {
resize: this.onPanelRendered
}
});
},
onPanelRendered: function() {
Ext.getCmp('certs_image').setHeight(Ext.getCmp('certs_panel').getHeight() - 100);
}
});


controller_invoices.js

Ext.define('ECS2.controller.controller_invoices', {
extend: 'Ext.app.Controller',
views: 'view_invoices_list',
stores: ['treestore_invoices'],
models: ['model_treestore_invoices']
});


model_treestore_invoices.js


Ext.define('ECS2.model.model_treestore_invoices', {
extend: 'Ext.data.Model',
fields: [
{name: 'text', type: 'string'},
{name: 'invoice_date', type: 'string'},
{name: 'invoice_number', type: 'string'},
{name: 'invoice_item', type: 'string'},
{name: 'invoice_item_series', type: 'string'},
{name: 'invoice_item_file', type: 'string'}
]
});


treestore_invoices.js


Ext.define('ECS2.store.treestore_invoices', {
extend: 'Ext.data.TreeStore',
rootVisible: false,
model: 'ECS2.model.model_treestore_invoices',
proxy: {
type: 'ajax',
url: 'load_invoices.php'
},
autoLoad: true
});


view_certs_preview_area.js


Ext.define( 'ECS2.view.view_certs_preview_area', {
id: 'certs_panel',
extend: 'Ext.panel.Panel',
alias : 'widget.view_certs_preview_area',
title: 'Certificates',
layout: {
type: 'hbox',
align: 'middle',
pack: 'center'
},
items: {
id : 'certs_image',
xtype: 'image',
src: 'images/test.png'
}
});


view_invoices_list.js


Ext.define('ECS2.view.view_invoices_list' ,{
id: 'invoices_list',
extend: 'Ext.tree.Panel',
alias : 'widget.view_invoices_list',
title: 'Invoices',
store: 'treestore_invoices',
rootVisible: false,
collapsible: true,
singleExpand: true,
listeners: {
itemclick: function(view, record, item, index, e, obj) {
if (record.getDepth('text') == 4) {
var oldstr = record.get('invoice_item_file');
Ext.getCmp('certs_image').setSrc('load_image.php?file_name=' + record.get('invoice_item_file'));
console.log(Ext.getCmp('certs_image').src);
}
}
}
});

Allan Stark
2 Aug 2012, 10:29 PM
Forgot to specify the version of ExtJS:
4.1.1, build date: 2012-07-04 21:11:01

Allan Stark
17 Sep 2012, 10:21 PM
IE very strict to arrays (need to add "[ ]" in declarations):



Ext.define('ECS2.controller.controller_invoices', {
extend: 'Ext.app.Controller',
views: ['view_invoices_list'],
stores: ['treestore_invoices'],
models: ['model_treestore_invoices']
});