0

I want to add a bryntum schedule (ExtJS framework) to my odoo module but I have problem with transferring data from and to its js file

my controller :

@http.route('/testjs', type="json", auth='public', website=True)
    def test(self):    
    return [{'name': 'amor', 'age': '20'},           
           {'name': 'james', 'age': '21'}]

and the js file is part which receives data:

 var resourceStore = new Sch.data.ResourceStore({   
         model   : 'Sch.model.Resource'});
 
 resourceStore.loadData([  //static data for test  
     {        Id      : 'a',        Name    : 'Rob'    },    
     {        Id      : 'b',        Name    : 'Mike'    }]);

note: I think I should use a proxy, but I don't know how

TylerH
  • 20,799
  • 66
  • 75
  • 101
Amor.o
  • 491
  • 8
  • 21

1 Answers1

0

you can try something like

$.getJSON('/testjs?',
    function(data) { ... }
);

for more info http://api.jquery.com/jQuery.getJSON/

kerbrose
  • 1,095
  • 2
  • 11
  • 22
  • the probleme that it's not a JQuery it's another js framework called ExtJS – Amor.o Feb 24 '18 at 14:45
  • that's no problem because in the client side of odoo you will find jquery already loaded & you can parse any data you receive to ExtJS as it all javascript – kerbrose Feb 25 '18 at 09:23