PDA

View Full Version : Ext.regModel , type attribute not working



kevinv1990
5 Oct 2010, 5:16 AM
I am using Sencha 0.96, I want to use the type 'date' in the regmodel, but getting an error:
TypeError: Result of expression 'a.name' [null] is not an object.
In the ext-touch.js

The regModel:


Ext.regModel('Vacatures', {
fields: [
{name: 'datum', type:'date'},
{name: 'titel'},
{name: 'functie'},
...
]
});

For people who want to know, reader snippit:


reader: {
type: 'json',
idProperty: 'id',
root: 'rows'
}

The json file, also tried the date without quotes:


{
"rows" : [
{
"id" : "1",
"datum" : "13/09/2010",
"titel" : "Administrateur IT",
"functie" : "Administrateur",
...

So how can I use the type 'date'?

Kevin

kevinv1990
5 Oct 2010, 6:51 AM
SOLVED:

You boys should update the API docs.. because :
{name: 'datum', type:'date'}
was not working, but:
{'name': 'datum', "type":"date"}
is working.

evant
5 Oct 2010, 2:03 PM
Assuming you were registering it on the client side there's no difference.



var o1 = {name: 'datum', type:'date'},
o2 = {'name': 'datum', "type":"date"};

console.log(o1.name == o2.name && o1.type == o2.type);