PDA

View Full Version : [FIXED] [B1] [object] properties strips to many chars, like ' and "



svenna
2 Feb 2012, 3:22 AM
Sencha Designer build 268.
ExtJs 4.07A

Im trying to configure a tips object.
Ext.chart.series.Line.tips.

In the properties I enter e.g


{
trackMouse: true,
width: 140,
height: 70,
renderer: function(storeItem,item) {
this.setTitle('Ugh');
}
}


However the result is without ' around Ugh


Ext.define('Dagsomsetning.view.base.MyLineSeries', {
extend: 'Ext.chart.series.Line',

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
type: 'line',
tips: {
trackMouse: true,
width: 140,
height: 70,
renderer: function(storeItem,
item){
this.setTitle(Ugh);
}
},
title: 'Ordre',
xField: 'dato',
yField: [
'ordresum'
],
fill: true
}, cfg)]);
}
});


Also stripping spacing:


{
trackMouse: true,
width: 140,
height: 70,
renderer: function(storeItem,item) {
var ugh = 'ugh';
this.setTitle('Ugh');
}
}


To:

Ext.define('Dagsomsetning.view.base.MyLineSeries', {
extend: 'Ext.chart.series.Line',

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
type: 'line',
tips: {
trackMouse: true,
width: 140,
height: 70,
renderer: function(storeItem,
item){
varugh=ugh;this.setTitle(Ugh);
}
},
title: 'Ordre',
xField: 'dato',
yField: [
'ordresum'
],
fill: true
}, cfg)]);
}
});



Some times the ' and " is included in the code, I've been unable to find the logic, but:


{
trackMouse: true,
width: 140,
height: 70,
renderer: function(storeItem, item) {
this.setTitle(
Ext.Date.format(storeItem.get('dato'),"D d.m.Y") +
"<br />Ordre: " + Ext.util.Format.number(storeItem.get("ordresum"),"0.000/i") +
"<br />Fakturert: " + Ext.util.Format.number(storeItem.get("fakturasum"),"0.000/i")
);
}
}


"renders" to:


Ext.define('Dagsomsetning.view.base.MyLineSeries', {
extend: 'Ext.chart.series.Line',

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
type: 'line',
tips: {
trackMouse: true,
width: 140,
height: 70,
renderer: function(storeItem,
item){
this.setTitle(Ext.Date.format(storeItem.get(dato),
Dd.m.Y)+<br/>Ordre: ' + Ext.util.Format.number(storeItem.get('ordresum'),'0.000/i') +
'<br/>Fakturert: ' + Ext.util.Format.number(storeItem.get('fakturasum'),'0.000/i')
);
}
},
title: 'Ordre',
xField: 'dato',
yField: [
'ordresum'
],
fill: true
}, cfg)]);
}
});

bharatn
2 Feb 2012, 8:09 AM
Confirmed bug. Thanks

svenna
9 Feb 2012, 3:41 AM
I guess many people come across this bug, when doing think like configuring a grouper of a list.

I found a workaround for the bug, that could be used in many of the situations that it occures.
(I actually figured it out while writing this post, in frustration, to ask if anyone had found a work around yet)

Since we are unable to have space after e.g. return (before variable name) we can only return "status" text - or concatenation text, starting with ''.

So coding


{
groupFn : function(record) {
return record.get('navn')[0];
}
}

does not work, since it "compiles" to:


{
groupFn : function(record) {
returnrecord.get('navn')[
0
];
}
}


However coding:


{
groupFn : function(record) {
return '' + record.get('navn')[0];
}
}

Works, since it "compiles" to:


{
groupFn : function(record) {
return''+record.get('navn')[
0
];
}
}



So, this makes be able to code most of the configurations, and test functionallity, while waiting for the bug fix.

Once fixed I will hopefully remember to remove ''+, but if I don't it's not the worst overhead you can have in an application :)

aconran
5 Mar 2012, 9:24 AM
We have a bunch of enhancements regarding editing both templates and functions in the coming builds which will address your concerns here.