[V2][Solved] Infinite scroll for Data table

Hello! Please tell me how to use Infinite scroll with Data table?

My code in ‘page content’ block:

    <div class="data-table">
      <div class="content-block">
        <table>
          <thead>
            <tr>
              <th class="numeric-cell">Column1</th>                  
              <th class="numeric-cell">Column2</th>
              <th class="numeric-cell">Column3</th>                 
            </tr>
          </thead>
          <tbody id="rows">
          </tbody>
        </table>
      </div>
    </div>

Code in js:

app.request.post('rows.php', function (data) {
          data=JSON.parse(data);
          var html=''; var i=0;
          while (i < data.length){ 
            html+='<tr>'+
                      '<td class="numeric-cell">'+data[i].column1+'</td>'+
                      '<td class="numeric-cell">'+data[i].column2+'</td>'+
                      '<td class="numeric-cell">'+data[i].column3+'</td>'+
                      '</tr>';
           i++;
          };
   $$('#rows').html(html);
});

Understood. It was not difficult.
But the method ‘append’ inserts html without markup (tr, td) , and the table is misplaced, although the data is displayed correctly.

before append ‘html’ is:

<tr>
  <td class="numeric-cell">1</td>
  <td class="numeric-cell">2</td>
  <td class="numeric-cell">3</td>
</tr>

after append ‘html’ is: 123

  $$('tbody').append(html);

Why?

Found on the forum:

It’s work:

$$('tbody').append($$(html));
1 Like

why,The difference between these two

$(self.$el).find(‘tbody’).append($$(linkHTML));
and
$(self.$el).find(’.links-list ul’).append(linkHTML);

I need your help