Add rows in a table after page 1 doesn't work

Add rows in a table after page 1 doesn't work

magarisiotismagarisiotis Posts: 2Questions: 0Answers: 0
edited February 2014 in Bug reports
Hello..

i have the following problem:

I am trying to add new rows into a table, after a specific index. The user clicks on a row and then the app loads some rows that contain some info regarding that entry.

On the first page it works as expected. Beyond that point (page 2 and so on) it does not insert the new rows.

[code]
$('#jtable1').on('click','button_class',function() {
.....
$.each(jsonresult, function(i,item){
subentries = subentries + ' '+ item['info1'] +''+ '';
});

$('#jtable1 > tbody > tr').eq(rowIndex).after(subentries);
[/code]

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    We'd need a link to the page (as noted int he forum rules) to be able to offer any help.

    Allan
  • magarisiotismagarisiotis Posts: 2Questions: 0Answers: 0
    Unfortunately i can't supply the link as it is an online platform.

    I did find what i did wrong though. On the page 2 and so on, the index of each row wasn't the right one and i needed to recalculate it.

    I did that by doing this:

    [code]
    var rowIndex = oTable.fnGetPosition( $(this).closest('tr')[0] );
    rowIndex = rowIndex - oSettings._iDisplayStart;
    [/code]
This discussion has been closed.