Hi,
I use Webix Jet and
I defined a data collection loaded from url like this:
define([
"app",
"models/licensingInfo",
], function (app, lic) {
the licensingInfo model is defined as
define(["app"], function (app) {
var collection = new webix.DataCollection({
url: "/api/licensing"
});
collection.attachEvent("onAfterLoad", function () {
app.callEvent("licensingInformationLoaded", [collection]);
})
return {
data: collection
};
});
When I load the page first time, the model loaded. But if I go to another page (by menu) and return back, the collection of data is empty. So I decided to force it to load in $oninit() function. But in this case the collection loaded twice when I go to the page first time.
I suspect that my solution isn’t good. So how to load the data defined in module every time when page is shown?