Dynamic Rowspan

Hi, let say if my data is loaded from database by sorting with name. What could I do to achieve the rowspan dynamically?

https://snippet.webix.com/h3z7cz1g

Hello,
Please check the related discussion .

Hi @Nastja,
this give me some idea, but doesn’t really fit my solution. By referring your discussion, I am looking for looping the Index column dynamically to addSpan

There is no built-in solution,

You can use onAfterLoad event, as in your snippet, just instead of hardcoded values traverse data for equal names

https://snippet.webix.com/9znoahfc

Hi @maksim , nice loop. Thanks for the prompt, I am still thinking of do another query for getting the count

Hi @maksim / @Nastja … Is there any reason if I load the data with URL, then the addSpan is not working? As if I use the data, it works fine, however, if I use URL, it did not span as expected.

the .load API is async, so you need to wait till end loading, before calling the addSpan ( or any other data related api )

some.load(url).then(addSpans)

or

{
   url:"some.php",
   ready: addSpans
}

Hi @maksim , I had tried

{
ready: function(){
this.addSpan(1, ‘name’, 1, 4);
}
}

It still give me the same result.

@maksim , suddenly realize actually onAfterLoad is still working, just because of missing this.refresh()

Thanks.