Hi,
Mohamed Cherif BOUCHELAGHEM
You can pass the data models to the view with control options or inside control:
- can.Control.extend('MyControl',{
- init:function(el,opts){
- //issume params
- var params={
- order:'create_time', //for sorting
- offset:0
- }
- MyModel.findAll({params:params}).done(function(data){
- //data is can.Model.List instance (Observable can.List)
- el.html(can.view('myview',{data:data}));
- });
- }
- })
here is a great example Weekly Widget 3 - Paginated Grid
In the canjs doc look at Component paginate
Full working example http://jsfiddle.net/cherif_b/8faGj/
Mohamed Cherif BOUCHELAGHEM