Making dynamic views

Hi webix team,

https://webix.com/snippet/98010b34

In this snippet id “mainContainer” having the 3 rows . Each row having 4 columns and column contain the key values.

In short I want 3 rows with 4 columns. Now I am getting only one row with 4 columns.
Please provide me the solution.

Thanks in advance.

https://webix.com/snippet/24c4e6b9

Thank you so much intregal

Hi intregal,

https://webix.com/snippet/299b0afc

Here in 1 row I am having 16 columns now.
But I want like 1 row having 4 columns(i.e 1 row 4 columns with 4 rows =16 data).
Means structure will be like each row having 4 columns and 4 rows. If data is of 17 there will be 4 columns with 5 rows.(This structure is of single row… repeated for other 2 rows as well)
Also each row(maincontainer rows having header)

Thanks,
Mira

Also each row(maincontainer rows having header)

Hello!
Please, clarify your use-case
According to the current description (assuming that each ‘cell’ has only text content), the implementation looks like dataview. Maybe you can try to implement it by such widgets as DataLayout or datatable.

@Nastja

My data is not fix. according to the data I want to create the row(now its 3 in my code). Also inside each row column count is fix(i.e. 4 in my code) but the rows inside each row will depends again on data.(suppose I am having 20 data in 1 row. It should get divide like 4 columns * 5 rows, 2nd row having 25 data then it will like 4 columns * 7 rows).Like this.

Can you please show a sample of your data?
As dataview has xCount property, the reason to use a separate template for each record is not clear.
Check the snippet, please: https://webix.com/snippet/933c2492

@ Nastja

I did it using dataview like this
https://webix.com/snippet/fbd9e98a

But I made it static.I want it dynamic.
Also in single row I am having year and ratings key:vlaue (i.e.2) but I want 4 key:value pair and 5th key:value pair will go to next line like that.
How I can do it dynamically?

Thnaks

Hi webix team,

https://webix.com/snippet/fd4564aa
In this snippet I want the dynamic view because now I make it like arr[0],arr[1] like this.It should be dynamic.
Also In single row I want only 2 column(or maybe 4).If its more than 2 it will go to next line.

Please reply me I am stuck on it.

Any help will be appreciated.
Thanks in advance

Unfortunately, using onAfterRender is not the best choice in this situation.
As ‘template’ can be a function, it already suits for the described scenario. Here is an example.
If the returned string has to be created dynamically, you can iterate through keys and add a needed piece of html to this string depending on a key index or value.

Hi,
My case is thar my keys are not fix. Sometimes i will get 2 keys 7 keys maybe 15 keys in that case i can not do like arr(1) or arr(2). It should be dynamic

There’s no ready to use solution for building a complex dynamic template.

The main pattern, i.e. usage of

template:function(obj){ 
   return "result"
}

is the same as described above.

The only task here is the algorithm which will return a proper string from any dataset, but again, unfortunately, we have no ready example for it.

But is it posible?

Please provide me the example for same.
I tried but not able to attach to the template.

You can make your template dynamic by implementing a bit more complex logic there: https://webix.com/snippet/a37400d3. But still the solution for achieving this structure within dataview cells is the template.

Thank you so much.
Working perfect.

Hi webix tam,

https://webix.com/snippet/bd2a775d
In this snippet I want the webix buttons after webix_strong class which will be inline…
I make the comment in snippet

As a solution, you can extend the template with clickable areas styled as Webix buttons (via webixbutton class). It is the recommended solution for such kind of tasks.
Please check the following example: https://webix.com/snippet/dd95fa6e

Thanks listopad. I will try it.