I was able to update the form values bind to tree, but how do I update the values of a list bind to the same tree?. For example if a list contains [‘orange’, ‘apple’, ‘tomato’], I would like to update the same with different values.
any update?
Not sure, but please check
http://docs.webix.com/samples/17_datatree/04_api/08_bind.html
http://docs.webix.com/desktop__binding_details.html
You can show a level of a tree in the bound component, or do the same for some sub-object stored in an item of a tree.
In the example http://webix.com/snippet/dfea3999 I am trying to replace the list with new list, so that it will be updated in tree. How do I do it?.
Check the updated snippet.
http://webix.com/snippet/70d8fdcd
When you are using $level, the item in list are nodes from tree hierarchy. You need to use the api of tree ( .remove, .add, .parse ) to alter them.
If you want to work with raw data, you can use “$data” instead. It links list to some array of object stored in the item of tree ( in such case the array of object is a separate entity, so you can replace it with new data at any moment )
Working perfect. Thank you.
Form and list bind to a same tree and when I modify the list and do a updateItem, I found the tree data has been updated. When I do a getDirtyValues(), I don’t find the changed values of form, because the list is not part of form. How do I list only the changed values, including the form fields and list when I do getDirtyValues()? The getCleanValues() basically listing all values bind to the tree, the getDirtyValues() listing only the values changed via setValues() API and not via updateItem.
If you see the demo, http://webix.com/snippet/69fbb2e9 both list and form are bind to tree. So, If I select any value in a tree and modify the value in form and list, when I click getDirtyValues, I got only the changes in form. How do I get the changes done in list also, so that I can handle the changes in server when I submit the form.
Unfortunately it will not work in such way. getDirtyValues is API of the form, so it tracks only values that was changed in the form.
It possible to wrap a list as form control, and place it in the form, in such case the getDirtyValues API will consider changes in list as well.
any idea which form control accepts array of values, so that the changes can be tracked.
- MultiText - http://docs.webix.com/desktop__multitext.html
- MutliCombo - http://docs.webix.com/desktop__multicombo.html
Also, you can wrap a list ( or any other data component ) as control of form
http://webix.com/snippet/9f166141
Thanks, since am not using the pro version, I will try to use the 3rd option.
So, is this the right way to do it with list?.
http://webix.com/snippet/aca95125
It must be like next
http://webix.com/snippet/b254282d
Unfortunately it doesn’t work correctly, as getDirtyValues can’t compare complex data types correctly
We will try to include a fix in the oncoming Webix 3.0
Thank you. I did in a different way and working good.
http://webix.com/snippet/1ea2b966