ColReorder - Server-side processing + Virtual Scroller

ColReorder - Server-side processing + Virtual Scroller

goannagoanna Posts: 4Questions: 1Answers: 0
edited September 2014 in Free community support

Can you indicate how can I configure ColReorder so that successfully works in server-side processing? Also, I use virtual scroller, which works fine dynamically.

ColReorder, in the examples provided, uses "dom": "Rlfrtip", while Scroller extension "dom": "rtiS". Which of the two is suitable so that both work fine together in server-side proc?

Any help is appreciated!
Anna

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    ColReorder - capital "R".

    Scroller - capital "S".

    Use them both in your "dom" initialisation.

  • goannagoanna Posts: 4Questions: 1Answers: 0
    edited September 2014

    Thanks, but the problem remains! I used "dom": "RlfrtiS". Virtual scroller works fine, but ColReorder not at all. Any help?

    //it is worth to mention that columns and data are returned from the server through ajax calls

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Did you download and include ColReorder js file? It's an extension:
    http://datatables.net/extensions/colreorder/

    Otherwise without seeing your code, I have no idea.

  • goannagoanna Posts: 4Questions: 1Answers: 0
    edited September 2014

    Yes, I know that ColReorder is an extension and I have included it. Here is my code:

    $.ajax({

    "url": "/command/core/get-columns",
    
    "data": {
        "project": id
    },
    
    "type": "POST",
    
    "success": function(columns) {
    
        var columnHeaders = [];
    
        for(var i=0; i<columns.length; i++) {
    
            columnHeaders.push({
    
                "title": columns[i],
    
                "defaultContent": "<i>null</i>"
    
            });
    
        }
    
        var table = $('#example').dataTable({
    
            "processing": true,
    
            "serverSide": true,
    
            "deferRender": true,
    
            "ordering": false,
    
            "searching": false,
    
            "dom": "RtiS",
    
            "scrollX": true,
    
            "scrollY": "800",
    
            "scrollCollapse": true,
    
            "scroller": {
                "loadingIndicator": true
            },
    
            "ajax": {
                "url": "/command/core/get-records?project=" + id,
                "type": "POST"
            },
    
            "columns": columnHeaders
    
        });
    
    }
    

    });

    In "dom", I tried, also, "dom": "RlfrtiS", but nothing. I use jquery-1.8.3 and DataTables-1.10.2 full package with its extensions.

    Any help?

This discussion has been closed.