The Webix library allows using Webix components with the Meteor framework.
The sources for integration of Webix with Meteor are not included into the Webix library package. You can take them from the GitHub repository
meteor npm i --save webix
meteor npm i --save webix-meteor-data
Movies = new Mongo.Collection("movies");
Using meteor->{collection} as the data URL:
webix.ui({
view: "datatable",
editable: true, editaction: "dblclick",
autoconfig: true,
// load data from the "movies" collection
url: "meteor->books",
// save data to the "movies" collection
save: "meteor->books"
})
Adding the url property will enable data loading and automatic component updates when data changes in the specified Collection.
The save property ensures that all changes in the component will be saved back to the Collection.
Instead of using a string for the url property, you can use cursors and collections directly.
Movies = new Mongo.Collection("movies");
var cursor = Movies.find();
webix.ui({
view: "list",
url: webix.proxy("meteor", cursor)
});
Movies = new Mongo.Collection("movies");
webix.ui({
view: "list",
url: webix.proxy("meteor", Movies),
save: webix.proxy("meteor", Movies)
});
Movies = new Mongo.Collection("movies");
webix.ui({
view: "list",
url: webix.proxy("meteor", Movies.find()),
save: webix.proxy("meteor", Movies)
});
You can use the load method to (re)load data in the component.
$$("datatable").load("meteor->movies");
or
$$("datatable").load(webix.proxy("meteor", Movies.find()) );
Webix components have the sync method to synchronize data between components. The method can be used with Meteor.
Movies = new Mongo.Collection("movies");
$$("details").sync($$("datatable"));
Back to top