sudara (owner)

Revisions

gist: 135534 Download_button fork
public
Public Clone URL: git://gist.github.com/135534.git
Text only
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  // Grab all users
  q = SC.Query.create({recordType:Listenapp.User});
  var users = Listenapp.alonetone.findAll(q);
 
  // Ok, now only get users starting with S
  q.set('conditions':'name STARTS_WITH "A"); //does not work actually, get syntax error
 
  // If I hack the data_source
  if(SC.instanceOf(fetchKey, SC.Query) && fetchKey.conditions === undefined) return [];
 
  // and do the following
 
   q= SC.Query.create({recordType: Listenapp.User, 'conditions':'name BEGINS_WITH "A"'});
   var users = Listenapp.alonetone.findAll(q);
 
  // then i get the result i'm looking for