PDA

View Full Version : Why the onMetaChange method isn't called with EXTJS4.0.7 ?



anto75
16 Feb 2012, 3:53 AM
Hi all,
at the moment I can create a data Store by AjaxProxy and I can getting the result.
BUT I saw that the event onMetaChange isn't called as in ExtJs 3...
Probably it changed the name??? (I hope in this :) )...
I think that I need of it because I have a StoreManager management with 'open' dataset (open = dynamic structure) ... so I cannot defining a fixed field object in my model. So, I think to use the metaChange event for update it in runtime.... Is it a correct logic? Do you could help my on this solution... or you know other knew ideas?
Thank in advance!!!!!
Antonella

mitchellsimoens
16 Feb 2012, 5:24 AM
metachange event is back in 4.1.0

anto75
16 Feb 2012, 5:44 AM
mmm ok... I read that it's a beta release... is it already stable for you??? You suggest to use it? I'd like to use it in a big project ... without surprises if it's possible!

Thank you,

Antonella

mitchellsimoens
16 Feb 2012, 5:46 AM
For my use cases it is stable.

anto75
16 Feb 2012, 5:47 AM
Right, than I download and try it!

To soon ;)

Anto

anto75
16 Feb 2012, 6:02 AM
Last question (I hope! )

Did you know the idicative period when the final extjs 4.1 release goes out?

Thanks,

Anto

mitchellsimoens
16 Feb 2012, 6:03 AM
It is planned to be mid to late March for final.

anto75
17 Feb 2012, 3:35 AM
Hi Mitchell,

as told yesterday I'm passed to the beta versione of ExtJS 4.1... It works correctly on Firefox and Chrome but I have some problem with IE 8.

Only in this browser I saw some execptions:


Linea: 3619
Carattere: 13
Codice: 0
Messaggio di Errore: Array or arguments object expected
in ext-4.1.0-beta-2/ext-all-debug.js


and than:


Linea: 9
Carattere: 4003
Codice: 0
Messaggio di Errore: Permission denied


I have semplified the logic, it should shows a very simple chart into a viewport... the same code with extjs 4.0.7 works correctly.

All starts with a jsp that makes next logic:


...
Ext.onReady(function() {
Ext.QuickTips.init();
var chartPanel = Ext.widget('ExtJSChartPanel',config); //by alias
var viewport = new Ext.Viewport(chartPanel);
});
...


And this is the ExtJSChartPanel.js file:


Ext.define('Sbi.extjs.chart.ExtJSChartPanel', {
alias: 'widget.ExtJSChartPanel',
extend: 'Ext.panel.Panel',
constructor: function(config) {
var defaultSettings = {
};

var c = Ext.apply(defaultSettings, config || {});

Ext.apply(this, c);

//this.init();
this.createExample(c);

this.callParent(this, c);
}

, createExample: function(config){
var store = Ext.create('Ext.data.JsonStore', {
fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'],
data: [
{ 'name': 'metric one', 'data1':10, 'data2':12, 'data3':14, 'data4':8, 'data5':13 },
{ 'name': 'metric two', 'data1':7, 'data2':8, 'data3':16, 'data4':10, 'data5':3 },
{ 'name': 'metric three', 'data1':5, 'data2':2, 'data3':14, 'data4':12, 'data5':7 },
{ 'name': 'metric four', 'data1':2, 'data2':14, 'data3':6, 'data4':1, 'data5':23 },
{ 'name': 'metric five', 'data1':27, 'data2':38, 'data3':36, 'data4':13, 'data5':33 }
]
});

this.chart = Ext.create('Ext.chart.Chart', {
renderTo: config.divId ,
width: 500,
height: 300,
animate: true,
store: store,
axes: [{
type: 'Numeric',
position: 'bottom',
fields: ['data1'],
label: {
renderer: Ext.util.Format.numberRenderer('0,0')
},
title: 'Sample Values',
grid: true,
minimum: 0
}, {
type: 'Category',
position: 'left',
fields: ['name'],
title: 'Sample Metrics'
}],
series: [{
type: 'bar',
axis: 'bottom',
highlight: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('data1') + ' views');
}
},
label: {
display: 'insideEnd',
field: 'data1',
renderer: Ext.util.Format.numberRenderer('0'),
orientation: 'horizontal',
color: '#333',
'text-anchor': 'middle'
},
xField: 'name',
yField: ['data1']
}]
});

}
});


Could you see some of wrong???

Thanks!

Anto

anto75
17 Feb 2012, 5:40 AM
HI all,

too this bug is closed.... the problem was a bad call to the parent constructor method...

Now it work with the 4.0.1 beta version too.

Regards,

Anto