PDA

View Full Version : [CLOSED-253] Store not mapping fields with ISO 8859-1 Characters in field name



SvenWS
2 Sep 2010, 1:02 AM
Sencha Touch version tested:

0.9 rev 3

only default ext-all.css


Platform tested against:

iOS 3.x


Description:

If special characters (see ISO 8859-1 characters table) are used in names for fields in a store model definition, the values of that field (column) will not filled to the records of the store.


Test Case:



Ext.regModel('testModel', {
fields: ['id', 'schlüssel', 'name', 'zähler']
});


Steps to reproduce the problem:

Just setup a store with above field model and deliver it with json data.


The result that was expected:

standard behavior


The result that occurs instead:

No field mapping


Debugging already done:

no


Possible fix:

not provided

evant
2 Sep 2010, 1:12 AM
Doesn't occur for me:



Ext.regModel('testModel', {
fields: ['id', 'schlüssel', 'name', 'zähler']
});

var store = new Ext.data.Store({
model: 'testModel',
data: [{
id: 'a',
schlüssel: 'b',
name: 'c',
zähler: 'd'
}]
});

console.log(store.getAt(0).get('zähler'));


Logs 'd' correctly. Using 0.93.

SvenWS
2 Sep 2010, 1:41 AM
You're right: I debugged the same result.

It's a problem of the tlp (XTemplate) definition of the connected List. If you use a ISO 8859-1 character in the tpl definition as the field placeholder like {schlüssel} the value of the record is not parsed in.

Jamie Avins
7 Sep 2010, 8:26 AM
Thanks, we're taking a look at the templates.

aconran
9 Sep 2010, 12:27 PM
You will need to use standard ASCII characters within your template. Our regex looks like:


/\{([\w-]+)\}/


Doesn't look like its easy to support unicode character matching cross-browser.
http://stackoverflow.com/questions/280712/javascript-unicode