bind datatable to property of list object

Hi,

I’m looking for a way to bind a datatable to a single property (an array) of the selected list object.
The objects in my list are similar to this: {name: “…”, lines: [{a:"", b:""}, {a:"", b:""}]
I have bound a form for the name property (and other properties), and below the form I want to have a datatable for the lines.

Is this possible using the bind function or do I have to do it manually (onItemClick).

Loving the framework by the way!

Thanks

Yep, you can embed grid in the form

http://webix.com/snippet/82e6c5f6

Basically any view that has setValue and getValue methods can be used as part of form.
Datatable doesn’t have such methods by default, so in the above code snippet we are creating a custom view - formtable - which is a datatable with two extra methods.

Now we can use it in form and it will use “name” attribute to take the necessary data from the form.

It works in backward direction as well, if you will make grid editable - all changes can be retrieved back by form’s API

that’s amazing! thanks for the quick reply

One minor addition to your code is to add this.clearAll() before doing the parse. If you don’t do this, the lines of other list items keep getting appended to the previous. Now it works perfectly.