Pacos
5 Sep 2011, 7:03 AM
Hello,
I have a chart :
var columnBI = Ext.create(Ext.chart.Chart, {
style: 'background:#fff',
animate: {
easing: 'bounceOut',
duration: 500
},
store: dshDetailStore,
flex: 1,
theme: 'Base:gradients',
width: 300,
height: 200,
shadow: true,
axes: [{
type: 'Numeric',
position: 'left',
fields: ['roi'],
title: '',
grid: true,
minimum: -100,
label: {font: '8px Arial'}
},{
type: 'Category',
position: 'bottom',
fields: 'name',
title: '',
minimum: 0,
label: {font: '8px Arial'}
}],
series: [{
type: 'column',
axis: 'left',
highlight: true,
xField: 'name',
yField: 'roi',
flex: 1,
theme: 'Base:gradients',
tips: {
trackMouse: true,
width: 150,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('roi') + ' %');
}
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
field: 'roi',
renderer: function (v) { return v + '%'; },
orientation: 'vertical'
}
}]
});
which is binded to a JSONStore :
var dshDetailStore = new Ext.data.JsonStore({
autoDestroy: true,
storeId: 'dshDetailStore',
proxy: {
type: 'ajax',
url: 'Controller?action=ddlist',
reader: {
type: 'json',
root: 'dshDetail',
idProperty: 'name'
}
},
fields: ['name', {name: 'itm', type: 'float'}, {name: 'bi', type: 'float'}, {name: 'roi', type: 'float'}]
});
Everything works fine, except for one situation : I reload the datastore after submitting a form, because the source data of this datastore has changed. In this exact case, the column chart cannot be rendered (it shows a blank area), and Firebug displays the same warning several time (seems to be one time per record of the datastore) :
Unexpected value matrix(NaN,NaN,NaN,NaN,NaN,NaN) parsing transform attribute
Here is the part of the form code that reloads the datastore :
var formSession = new Ext.FormPanel({
[... properties ...],
items: [{
layout:'anchor',
bodyStyle:'padding:5px 5px 0',
items:[...],
buttons: [{
text: 'Save',
handler: function(){
if(formSession.getForm().isValid()){
formSession.getForm().submit({
url: 'Controller',
method:'POST',
waitMsg: 'Saving Session',
params: {
action: 'sAdd'
},
success: function(){
Ext.Msg.show({
title:'Success',
msg: 'Session successfully saved.',
buttons: Ext.Msg.OK
});
sessionStore.load();
dshSumStore.load();
// HERE IS THE LOAD
dshDetailStore.load();
dshTitleStore.load();
Ext.getCmp('combo-room').reset();
Ext.getCmp('combo-tournament').reset();
Ext.getCmp('nfield-rebuy').reset();
Ext.getCmp('cbox-addon').reset();
Ext.getCmp('nfield-itm').reset();
},
failure: function(){
Ext.Msg.alert('Error', 'Error while saving.');
}
});
}}
}]
});
Can anyone help me to solve this case ? Thank you !
I have a chart :
var columnBI = Ext.create(Ext.chart.Chart, {
style: 'background:#fff',
animate: {
easing: 'bounceOut',
duration: 500
},
store: dshDetailStore,
flex: 1,
theme: 'Base:gradients',
width: 300,
height: 200,
shadow: true,
axes: [{
type: 'Numeric',
position: 'left',
fields: ['roi'],
title: '',
grid: true,
minimum: -100,
label: {font: '8px Arial'}
},{
type: 'Category',
position: 'bottom',
fields: 'name',
title: '',
minimum: 0,
label: {font: '8px Arial'}
}],
series: [{
type: 'column',
axis: 'left',
highlight: true,
xField: 'name',
yField: 'roi',
flex: 1,
theme: 'Base:gradients',
tips: {
trackMouse: true,
width: 150,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('roi') + ' %');
}
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
field: 'roi',
renderer: function (v) { return v + '%'; },
orientation: 'vertical'
}
}]
});
which is binded to a JSONStore :
var dshDetailStore = new Ext.data.JsonStore({
autoDestroy: true,
storeId: 'dshDetailStore',
proxy: {
type: 'ajax',
url: 'Controller?action=ddlist',
reader: {
type: 'json',
root: 'dshDetail',
idProperty: 'name'
}
},
fields: ['name', {name: 'itm', type: 'float'}, {name: 'bi', type: 'float'}, {name: 'roi', type: 'float'}]
});
Everything works fine, except for one situation : I reload the datastore after submitting a form, because the source data of this datastore has changed. In this exact case, the column chart cannot be rendered (it shows a blank area), and Firebug displays the same warning several time (seems to be one time per record of the datastore) :
Unexpected value matrix(NaN,NaN,NaN,NaN,NaN,NaN) parsing transform attribute
Here is the part of the form code that reloads the datastore :
var formSession = new Ext.FormPanel({
[... properties ...],
items: [{
layout:'anchor',
bodyStyle:'padding:5px 5px 0',
items:[...],
buttons: [{
text: 'Save',
handler: function(){
if(formSession.getForm().isValid()){
formSession.getForm().submit({
url: 'Controller',
method:'POST',
waitMsg: 'Saving Session',
params: {
action: 'sAdd'
},
success: function(){
Ext.Msg.show({
title:'Success',
msg: 'Session successfully saved.',
buttons: Ext.Msg.OK
});
sessionStore.load();
dshSumStore.load();
// HERE IS THE LOAD
dshDetailStore.load();
dshTitleStore.load();
Ext.getCmp('combo-room').reset();
Ext.getCmp('combo-tournament').reset();
Ext.getCmp('nfield-rebuy').reset();
Ext.getCmp('cbox-addon').reset();
Ext.getCmp('nfield-itm').reset();
},
failure: function(){
Ext.Msg.alert('Error', 'Error while saving.');
}
});
}}
}]
});
Can anyone help me to solve this case ? Thank you !