Styling colvis checkboxes with jquery uniform plugin

Styling colvis checkboxes with jquery uniform plugin

dyapasrikanthdyapasrikanth Posts: 20Questions: 0Answers: 0
edited May 2012 in General
How to apply jquery uniform style plugin for colvis checkboxes, I am loading data from server, so uniform plugin unable to customize the colvis checkboxes because these are going to be loaded after page load.

When i need to apply this plugin
$("input:checkbox").uniform();

Replies

  • snarf2larfsnarf2larf Posts: 64Questions: 0Answers: 0
    Try adding it after the table is drawn using fnDrawCallback:

    http://www.datatables.net/ref#fnDrawCallback
  • dyapasrikanthdyapasrikanth Posts: 20Questions: 0Answers: 0
    edited May 2012
    Thanks for the reply, but its not working

    [code]
    oTable = $('#dyapasrikanth').dataTable({
    "sScrollY": $(document).height()-170,
    "iDisplayLength": 50,
    "bPaginate": false,
    "bLengthChange": false,
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "bProcessing": true,
    "fnDrawCallback": function( oSettings ) {
    $("input:checkbox").uniform();
    },
    "fnInitComplete": function() {
    // custom scroll bars
    var settings = {
    showArrows: false,
    autoReinitialise: true
    };
    $('.dataTables_scrollBody').jScrollPane(settings);
    },
    "bServerSide": true,
    "sDom": 'R<"H"Cfr>t<"F"ip>',
    "oColVis": {
    "aiExclude": [ 0 ],
    "buttonText": " Change Columns "
    },
    "fnServerData": function ( sSource, aoData, fnCallback ){
    var vCols = fnGetVisibleCols(this);
    aoData.push( { "name": "vCols","value":vCols} );
    $.getJSON( sSource, aoData, function (json) {
    fnCallback(json)
    });
    },
    "sAjaxSource": "<%=basePath%>contacts.action?action=view",
    "aoColumns": [
    { "mDataProp": "rowId" },
    { "mDataProp": "firstName" },
    { "mDataProp": "middleName" },
    { "mDataProp": "lastName" },
    { "mDataProp": "extNo" },
    { "mDataProp": "landlineNo" },
    { "mDataProp": "mobileNo" },
    { "mDataProp": "emailId" },
    { "mDataProp": "department" }
    ],
    "aaSorting": [[ 1, "asc" ]],
    "aoColumnDefs": [
    { "bSearchable": false,"bSortable": false, "bVisible": false, "aTargets": [ 0 ] },
    { "sWidth": "140px","aTargets": [ 8 ] },
    { "sWidth": "100px","aTargets": [ 4 ] },
    { "sWidth": "100px","aTargets": [ 5 ] },
    { "sWidth": "30px","aTargets": [ 6 ] },
    { "sWidth": "90px","aTargets": [ 7 ] }
    ]
    });
    [/code]
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Looks like it should work to me. Can you give us a link to a test case showing the problem please?

    Allan
  • roineroine Posts: 14Questions: 0Answers: 0
    edited September 2012
    Hey, I've met the same problem and tried[code]
    "fnDrawCallback": function( oSettings ) {
    console.log($('input'))
    }[/code]
    the console.log doesnt return the checkboxes
This discussion has been closed.