Webix Jet scope in ajax.post for In-App navigation

Hi,

im using Webix Jet and its documented this.$scope.show(“subpagex”); way of inapp navigation:

But i have troubles to use this method inside the ajax.post function:

$oninit: function(view, $scope){
	$scope.on(app, "onAdd" ,function(){
		webix.ajax().post("URL", myJsonCheckedIds, function(text, data){
			this.$scope.show("subpagex"); //error: Uncaught TypeError: Cannot read property 'show' of undefined
		});
	}
}

How to use this.$scope.show(“subpagex”) inside the webix.ajax().post() ?

The thing is that this refers to webix.ajax module inside Ajax callback function.

You can use webix.bind helper to pass this reference into the callback:

webix.ajax().post("URL", {}, webix.bind(function(text, data){
   this.$scope.show("subpagex"); 
 }, this));