Why does this.set not work used in this Javascript function in Kendo -


I have a condo mobile app and a view is trying to use modell to use the reveling module pattern.

In my HTML, I list games listdatasource. OnInit, I get the data and then let me tell the HTML that the data source has changed. This code works well (although I think I am doing some time here as I can display the data source directly).

1) If I comment on this line: GamesListViewModel.refreshGamesList (dataSource); And delete this line: this.set ("gamesListDataSource", data source); So that it is directly called in the LoadJameslist function, then it ends with "Uncount Type Error: Object [Object Object]. There is no method set in it"

I think this fact Is that to fetch () Asynch, but I do not understand why calling other functions works fine?

gamesList.js

  (function (global) {Var GamesListViewModel, app = global.app = global.app || {}; GamesListViewModel = kendo.observable ({gamesListDataSource: {}, refresh GamesList: functions (datasource) {// This function works fine when called in, but not in the Inbox Load Gomes list () this.set ("gamesListDataSource" , Data source);}, loadGamesList: function () {dataSource = new kendo.data.DataSource ({transport: {read: {url: app.configuration.getGamesListUrl, dataType: "Json"}}}}) console .log (datasourcer ()); datasource.phat (function () {console.log ('read done'); console.log (datasource This line, given below, is randomly presenting it as // new.sss (datasource ", datasource); GamesListViewModel.refreshGamesList (data source);});}, OnInit: function (e) {console. GamesListViewModel.loadGamesList ();}}); App.gamesListService = {Visual MODEL: GamesListViewModel};}} (window);   

GamesList.html

     

kendo.data to fetch data sources. Js ; In essence, it does something like this:

  fetch: function (callback) {var that = it; ... if (fetch successful) {if (callback) {// As you can see here, when your callback can be implemented, // code calls "this" to the data source frequency // You called fetch () on the callback. Call (he, e); }}},   

This method is used in many other ways which accept callback - With the Candido UI, you can usually this that widget You can expect that your other call works on a method that you say because you refer to this rather than the GamesListViewModel variable. You can also: GamesListViewModel.set ("gamesListDataSource", data source);

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -