How bind databable and form?
View
`
define([
"models/settings"
],function(settings){
var ui = {
cols : [
{
view:"datatable",
id:"rating:table",
columns:[
{ id:"code", header:"Code", editor:"text"},
{ id:"rate", header:"Rate", editor:"text"},
],
datatype:"json",
select:"row",
editable:true,
editaction: "dblclick",
autowidth:true
},
{
view : "form",
id: "rating:form",
rows : [
{ view : "text", label : "Code", name : "code", width: 300 },
{ view : "text", label : "Rate", name : "rate" },
{ view : "button", label : "Save", type: "form", click: '$$("rating:form").save' }
]
}
]
};
return {
$ui: ui,
$oninit:function(view,$scope) {
$$("rating:table").parse(
[{
"code": 112,
"rate": 1,
}, {
"code": 114,
"rate": 3,
}
]
);
$$("rating:form").bind($$("rating:table"));
},
};
});
`
Selection of any datatable item will result in the form filling with data from the table.
There is error “webix.$$(…) is null” by clicking on button Save in the form.
Can you help me save data?