How to prevent the page jumping to top when sorting

How to prevent the page jumping to top when sorting

jerry98225jerry98225 Posts: 10Questions: 0Answers: 0
edited March 2012 in General
Hi guys, I just wanted to know how to prevent the page jumping to top whenever I click the text to sort the column. Thanks for the help.

Jerry

Replies

  • trishdevtrishdev Posts: 13Questions: 1Answers: 0
    Hey I am having the same problem.. I just dropped a datatable with static data into a frameset which is a style guide of all our components.. now on a couple of the thead th that are sortable it returns the top of page.. Very strange because 3 of the other sortable thead th actually sort like expected.. Note this datatable worked in a separate html file... no problems.. I would guess that it is something to do with the frameset and it being down on the page some?? The code appears to be indentical when checking in firebug.. Anyone have any ideas how to make these columns sort like they did before.. I would give a sample but this is on an internal website only.. Here is initialization code:

    oTable = jQuery('#example-flex').dataTable({
    "bJQueryUI": true,
    "bStateSave": false,
    "sScrollx": "100%",
    "sScrollXInner": "120%",
    "aLengthMenu": [[10, 25, 50], ['10', '25', '50']],
    "bAutoWidth": true,
    "bProcessing": true,
    "aoColumnDefs": [

    {"sClass": "nosort", "aTargets": [0, 6, 7] },
    { "bVisible": true, "aTargets": [0, 1, 2, 3, 4, 5, 6, 7] },
    { "bSortable": false, "aTargets": [0, 6, 7] }
    ],
    "sPaginationType": "input",
    "sDom": 'R<"toolbar ui-widget-header">i<"tools"T><"cols"C><"secondary"fl<"pager"p>><"wrapper-scroll"rt><"clear"><"bottom"ilp>',
    "oTableTools": {
    "sSwfPath": "theme/media/swf/copy_cvs_xls_pdf.swf",
    "aButtons": [
    {
    "sExtends": "collection",
    "sButtonText": "Save As",
    "aButtons": ["csv", "xls", "pdf"]
    },
    {
    "sExtends": "collection",
    "sButtonClass": "more",
    "sButtonText": "More",
    "aButtons": ["copy", "print"]
    }
    ]
    },
    "oColVis": {
    "aiExclude": [8],
    "bRestore": true,
    "bShowAll": true
    }


    });
    jQuery("div.toolbar").html('Search Results');
    jQuery('').insertAfter(".ColVis_Button.TableTools_Button.ui-button.ui-state-default.ColVis_MasterButton>span");
    jQuery('').insertAfter('#ToolTables_example-flex_0>span');
    jQuery('').insertAfter('#ToolTables_example-flex_4>span');
    oTable.$('td').wrapInner('');

    table is like this::




    Type


    Bill To


    Ship To


    Customer Name


    Address


    Phone #


    DEA


    Cart









    249089


    249089



    Burke & Robinson M.D.P.C., Dr



    1501 Miluli Ave, Bainbridge, GA 39819-5700


    (229) 243-0152













    249095


    249095



    Capital Health Plan




    2140 Centerville Place Chp Ap Po Box 15349, Tallahassee, FL 32317


    (850) 383-3567
















    249095


    249096



    Capital Health Plan



    1491 Governors Square Blvd, Tallahassee, FL 32301-3049


    XXX-XXX-XXXX










    thanks,
    Trish
This discussion has been closed.