webix jet call subview

Hi,

I want to call a subview when clicking a button but i have a js error about app object and i do not how to solve it…

i have created a snippet. Check it out: http://webix.com/snippet/ff2299d6

Is snippet ready for webix jet? bacause i can not compile my code there.

My local output (js) is this:

TypeError: Object # has no method ‘callEvent’

The error happens when i click on the button and raises the event for create the subview.

i tested changing callEvent function to trigger, or changing event and raising functions with action app function…but no luck.

On the other hand, could you share to me how to call a subview from my sample event “goToSupport”. give me a simple sample please…

Thanks and regards!

a) the code that you have provided works correctly for me. Be sure that you have the app.js on top level that contains something like next

define([
	"libs/webix-mvc-core/core"
], function(
	core
){

	var app = core.create({
		id:         "Designer",
		name:       "Designer",
		version:    "0.1.0",
		debug:      true,
		start:      "/form"
	});

	return app;
});

https://s3.amazonaws.com/uploads.hipchat.com/15721/61242/vd6gHEMdqKefOpd/app-jet-very-simple.zip

Thanks!

Now it works, but how can i call to a subview?

can you give me a sample? for example… on that event

app.attachEvent(“goToSupport”, function (mode) {
alert(1);

           call a subview to attach/overwrite to a layout

});

Thanks!

You need to provide a new URL

app.attachEvent("goToSupport", function (mode) { 
   //show support view in a subview section
   //assuming that the top level view is stored in the top.js
   //and support view page is stored in support.js
    app.show("/top/support");
});