Добрый день.
Не подскажите - можно ли вытянуть из состояния TreeTable данные ?
Т.е. получить модель данных чтобы потом её всю отправить на сервер ?
Или есть какой-то другой способ получить все данные компонента ?
How to pull data from the state (TreeTable) ?
Hi!
It is possible to extract the data from the TreeTable (or any data component as well) through theserialize
method.
Besides, all features of the TreeTable state are described here.
There is an analogy method getValues for TreeTable ?
By default, getValues() is the method for the ui.form to get all values from the components that have bothname
(for the interaction with form) andvalue
properties.
serialize
is the method to get the data as JSON, so it can be sent to the server.
If you need to embed a treetable (or list, datatable, etc.) into the form, you can extend it with set- and getValue methods and configure them as you wish. Please check the following topic:
http://forum.webix.com/discussion/7135/create-form-with-other-components
grid = new webix.ui({
view:“treetable”,
name:“formtable1”,
setValue:function(value){
this.clearAll();
this.parse(value)
},
getValue:function(){ return this.serialize(); }
});
var form = webix.ui({
view:"form",
elements:[
{ view:"formtable1", autoConfig:true, data:[], name:"dt1" }
]
});
Uncaught TypeError: e[i] is not a constructor
A custom component can be created through the protoUI. Please check the related article. And here’s the working example: