Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Ordering error - fixture/store - findAll()

$
0
0
Hi,
I am starting with can.fixture and Store.
My store instance:

 var storeTutor = fixture.store(40, 
        function(i){
            return {            
                id : i+1,
                name : FIRSTNAMES[can.fixture.rand(0,FIRSTNAMES.length)],
                discipline : DISCIPLINES[can.fixture.rand(0,DISCIPLINES.length)],
                description : TUTORDESCRIPTION[can.fixture.rand(0,TUTORDESCRIPTION.length)],
                status : STATUS[can.fixture.rand(0,STATUS.length)],
                ranking : RANKING[can.fixture.rand(0,RANKING.length)],
                price : PRECO[can.fixture.rand(0,PRECO.length)]            
            }
        },
        function(item, settings){ 
         ....
        }

Looking for Ajax Request:
      fixture({
        ...
        'GET /tutors' : storeTutor.findAll,
        ...

When calling model findAll:

this.options.Tutor.findAll({search : search, order: 'name ASC'},function(result){
               self.options.items = result; 
               self.element.html(initView({options: self.options})); 
 });                          

Because of the "order" parameter an error is raised:
Firebug:
      TypeError: [].slice(...).reverse is not a function

My guess is that Store does not like my storeTutor structure...

Can you help me here?

Thanks a lot.

Cheers,
Linton Fernandes

Viewing all articles
Browse latest Browse all 3491

Trending Articles