Clusterize.js icon indicating copy to clipboard operation
Clusterize.js copied to clipboard

How to best insert elements in the middle of an existing list?

Open dkwin opened this issue 7 years ago • 4 comments

Revising my previous issue to simplify a question,

According to the API, there is a prepend and append but there is no insertAt (index).

I'm wondering how I can best implement this while maintaining the integrity of the clusters?

dkwin avatar Feb 15 '17 19:02 dkwin

I am also after a removeAt(index) function as well

Tim-Intellipharm avatar Apr 02 '17 23:04 Tim-Intellipharm

During initialization you provide array of data to rows parameter.

var data = ['<tr>…</tr>', '<tr>…</tr>', …];
var clusterize = new Clusterize({
  rows: data,
  scrollId: 'scrollArea',
  contentId: 'contentArea'
});

Later in your code change this data array as you need and call clusterize.update(data)

NeXTs avatar Jul 16 '17 10:07 NeXTs

@NeXTs what if we use the dom element on init ? I have a table with a few rows and based on user interactions will add some rows in between (expand functionnality) how do I tell clusterize to refresh ?

Dams591 avatar Sep 26 '18 15:09 Dams591

I have a quick question regarding expand/collapse of the html table. We have an html table which shows hierarchy and when I do collapse it only collapses the rows in the block. I was wondering if there is a way to collapse all the rows which have not been loaded yet.

shakunvohra avatar Oct 02 '18 02:10 shakunvohra