add view text elements in form with loop

Hello , is it possible to use a loop in a form ?
Something like that :

for (i=0; i<32;i++){
{view:“text”, id: “test_” +i, …}
}

Hello,

You can use the addView method after init:

for (i=0; i<32;i++){ 
    form.addView({view:"text", name:"test_"+i, placeholder:"test_"+i}) 
}

http://webix.com/snippet/d0003558

Ok thanks, so i try to do an array 8 x 4 in a form and I don’t know what is the best way to do that with webix , maybe two loop with “cols” and “rows” ? maybe datable with editable fields (not the first column) ?

I have that in php and html and I try to have the same in webix :

http://webix.com/snippet/0eae01c0

The snippet is the representation that i want in webix

Thanks

I try with an editable datatable and I think it’s more efficient.
The last thing to do is data processing when I save the form and bind data when I load :wink:

How it’s the best way to send/load datable data to/from the server ?

I have a form with a datatable : http://webix.com/snippet/f972c3c2

When I send a request to the server on a click button , i have only the name in the POST , I tried $$(“moxaIoForm”).bind($$(“moxaIoDatatable”)) but it doesn’t work.

When I send a request I use in parameter : $$(“moxaIoForm”).getValues();

I wish in POST something like that :
ai0_min : x
ai0_max : y

ai7_hysteresis : k
ai17_unit : z

Any ideas ?

Loading patterns for the datatable and the form are different. Datatable uses a datastore (load, parse API) while form works with a simple object with some attributes (setValues API) represented as { name1:value1, name2:value2, etc. }. But you can load all the data from the same object:

http://webix.com/snippet/c9de7136

Thanks for the response , so I tried your example but I don’t have dynamically the values changed in the datable when I send the resquest to the server.
My problem is :
In first, I have a form with a lot of controls and in this form a datatable with a static column (to identify the id A0 , A1). When I change all controls and severals values in datatable (all columns with : editor: “text”) , I wan’t to submit one request in server , with all data (forms controls + all values in datatable) that represent one object. Is it possible to do that?
Secondly, when I load data from server, i believe i must load form values in first in one request , and use a second request with id of object ( modbus_name) for load the datatable , is it correct ?
I don’t know if I am clear but i thank you for your time and your reactivity :wink:

Hello, you can create a custom datatable that features typical methods of form elements (.getValue(), .setValue()). It will be possible then to set and get form values as a whole to use in loading and sending to server:

http://webix.com/snippet/2af45cd6