Guest User

Untitled

a guest
Jul 21st, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. define([
  2.  
  3. ],function(){
  4.   var ui = {
  5.     rows: [
  6.     {
  7.       id: "class",
  8.       view: "datatable",
  9.     },
  10.     {
  11.       id: "students",
  12.       view: "datatable",
  13.     },
  14.     ]
  15.   };
  16.  
  17.   return {
  18.     $ui: ui,
  19.     $onurlchange: function(config, url, $scope){
  20.       if(config.ClassId){
  21.         $$("class").url = "http://localhost:5000/api/class/" + config.ClassId + "/";
  22.         $$("class").load($$("class").url);
  23.         $$("students").data = webix.ajax($$("class").url).then(function(data){ return data.json().students; });
  24.         $$("students").load();
  25.       }
  26.     }
  27.   };
  28.  
  29. });
Advertisement
Add Comment
Please, Sign In to add comment