Problem with Multiple tables with rowReordering

Problem with Multiple tables with rowReordering

NathanielBNathanielB Posts: 6Questions: 0Answers: 0
edited July 2012 in Plug-ins
Hello all,

I'm a newbie here and this is my first post. I'm having a problem with rowReordering when using multiple tables. I can reorder the first table just fine but the second table I can’t move the first few rows. I checked the code and oState.iNewPosition is showing the first rows to be -1. If I run the table by themselves then they work as intended.

The other problem I have is that rowReordering does not seem to work if I have "bSort” set to false. Is there a work around to remove the sort arrows in the ?

The first table
[code]
var oTable1 = $('#tableTop').dataTable(
{
"bPaginate" : false
,"bFilter" : true
,"bInfo" : false
//,"bSort" : false
,"bSortClasses" : false
,"bAutoWidth": false
,"oLanguage": {
"sSearch": ""
}
}).rowReordering({
bGroupingUsed: false,
iIndexColumn:0,
sURL:"{the path here}",
fnAlert: function(message) {
alert(message);
}
});
[/code]

The second table with rowGrouping
[code]
var oTable2 = $('#tableSide').dataTable(
{
"bPaginate" : false
,"bFilter" : true
,"bInfo" : false
//,"bSort" : false
,"bSortClasses" : false
,"bAutoWidth": false
,"oLanguage": {
"sSearch": ""
}
})
.rowGrouping({ iGroupingColumnIndex: 0 })
.rowReordering({
bGroupingUsed: true,
iIndexColumn:1,
sURL:"{the path here}",
fnAlert: function(message) {
alert(message);
}
});
[/code]

Replies

  • NathanielBNathanielB Posts: 6Questions: 0Answers: 0
    After additional testing I found rowReordering fails at the function oTable.fnGetData.

    var iCurrentPosition = oTable.fnGetData(tr[0], properties.iIndexColumn);
  • NathanielBNathanielB Posts: 6Questions: 0Answers: 0
    I found the issue. I had the id of in each table using the id number of the row in my database and since these are different database tables they had the same id numbers. I added "Top-" and Side- to differentiate the two.

    First table
    echo "";

    Second table
    echo "";
  • NathanielBNathanielB Posts: 6Questions: 0Answers: 0
    The bsort issue is somewhat fixed. The row change is saved in the database but the row index order is not resetting. if I have rows 12345 and I move 1 to 3 the table will show 31245.
  • NathanielBNathanielB Posts: 6Questions: 0Answers: 0
    I ended up leaving bsort enabled and just set the style to a clear.gif image.
This discussion has been closed.