Skip to content

Instantly share code, notes, and snippets.

@tejastank
Created July 20, 2012 03:02
Show Gist options
  • Save tejastank/3148404 to your computer and use it in GitHub Desktop.
Save tejastank/3148404 to your computer and use it in GitHub Desktop.
webatom
getrecords:function(model,domain){
domain = [[1,'=',1]]; // conditional parameter to filter data from server.
var ids = this.rpc.db(["database_name","userid","password",model,"search", [
domain,"",((this.currentpage) * this.listlimit),this.listlimit
]])
// var field_names = _.pluck(this.ir.data.viewarch.field.tree.field ,'name'); // with form view this does not require.
var recs = this.rpc.db(["database_name","userid","password",model,"read", [
ids
]]);
_.each(recs[0],function(value, key){
$("#form_field_"+key).val(value);
});
return recs;
},
nextpage:function(event){
++this.currentpage;
console.log(this.currentpage);
//this.render();
this.getrecords(this.model,"");
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment