Dashboard 中 datatables 输出 checkbox 样式失效

使用datatables ajax 输出的 checkbox 竟然丢样式了?

  $('#div_list').dataTable({
            "aaData": jsn.aaData,
            "aoColumns": [
            {
                "mRender": function (data, type, full) {
                    sReturn = '<input type="checkbox" value="1" />';
                    return sReturn;
                },
                "sClass": "checkboxes"
             },
            { "sTitle": "品牌名称" },
            { "sTitle": "品牌头像" },
            { "sTitle": "品牌账号" },
            { "sTitle": "品牌主页背景", "sClass": "center" },
            {
                "sTitle": "创建时间",
                "sClass": "center"
               
            }
        ]
   //省略.....

效果:

checkbox 样式丢了!。!

 

解决方法:

        $('#div_list').dataTable({
            "aaData": jsn.aaData,
            "aoColumns": [
            {
                "mRender": function (data, type, full) {
                    sReturn = '<input type="checkbox" value="1" />';
                    return sReturn;
                },
                "sClass": "checkboxes"
             },
            { "sTitle": "品牌名称" },
            { "sTitle": "品牌头像" },
            { "sTitle": "品牌账号" },
            { "sTitle": "品牌主页背景", "sClass": "center" },
            {
                "sTitle": "创建时间",
                "sClass": "center"
               
            }
            ],
            "fnDrawCallback": function () {
                App.initUniform();
            },

看最后的三行..

 源自:http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469/comments?filter=all&term=datatable+vertical+scroll

posted @ 2014-03-07 00:02  三个安目  阅读(2757)  评论(1编辑  收藏  举报