This topic contains 7 replies, has 2 voices, and was last updated by Sean Sean 2 years, 7 months ago.

checkbox in datatable doesnt get uniform'd


  • rsquarev
    Participant

    Posts: 15
    Member Reply #3422

    After calling dataTable, I expected the checkboxes will have a div,span wrapped. But its not adding div,span even I called $.uniform.update(set). What is the wrong I am doing?, I used  your example table-datatables-managed.js to make this code. I even checked the order of css and js files. they are all matching with your example. Please help.

    Admin1 layout and material design.

    dataTableReservedLoans = tableReservedLoans.dataTable({

    “ajax”: {

    “url”: apiUrlBase,

    “dataSrc”: “”

    },

    “fixedHeader”: “true”,

    “columns”: [{

    “data”: “null”, “orderable”: false, “searchable”: false, “render”: function (data, type, full, meta) { return ‘<input type=”checkbox” class=”checkboxes” value=”1″ />’; }

    },

    { “data”: “Environment” }, { “data”: “Client” }, { “data”: “LoanNumber” }, { “data”: “DateCreated” }, { “data”: “Comment” },

    { “data”: null, “orderable”: false, “searchable”: false, “render”: function (data, type, full, meta) { return ‘Edit‘; } }

    ],

     

    //”processing”: true,

     

    “createdRow”: function (row, data, dataIndex) { $(row).addClass(‘gradeX’); },

     

    “language”: {

    “aria”: {

    “sortAscending”: “: activate to sort column ascending”,

    “sortDescending”: “: activate to sort column descending”

    },

    “emptyTable”: “No data available in table”,

    “info”: “Showing _START_ to _END_ of _TOTAL_ records”,

    “infoEmpty”: “No records found”,

    “infoFiltered”: “(filtered1 from _MAX_ total records)”,

    “lengthMenu”: “Show _MENU_ records”,

    “search”: “Search:”,

    “zeroRecords”: “No matching records found”,

    “paginate”: {

    “previous”: “Prev”,

    “next”: “Next”,

    “last”: “Last”,

    “first”: “First”

    }

    },

     

    // Uncomment below line(“dom” parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout

    // setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js).

    // So when dropdowns used the scrollable div should be removed.

    //”dom”: “<‘row'<‘col-md-6 col-sm-12’l><‘col-md-6 col-sm-12’f>r>t<‘row'<‘col-md-5 col-sm-12’i><‘col-md-7 col-sm-12’p>>”,

     

    “bStateSave”: true, // save datatable state(pagination, sort, etc) in cookie.

     

    “lengthMenu”: [

    [5, 10, 15, 20, -1],

    [5, 10, 15, 20, “All”] // change per page values here

    ],

    // set the initial value

    “pageLength”: 10,

     

    “order”: [

    [2, “asc”]

    ] // set first column as a default sort by asc

    });

     

    //var tableWrapper = jQuery(‘#tblReservedLoans_wrapper’);

     

    //tableWrapper.find(‘.dataTables_length select’).select2(); // initialize select2 dropdown

     

    tableReservedLoans.find(‘.group-checkable’).change(function () {

    var set = jQuery(this).attr(“data-set”);

    var checked = jQuery(this).is(“:checked”);

    jQuery(set).each(function () {

    if (checked) {

    $(this).prop(“checked”, true);

    $(this).parents(‘tr’).addClass(“active”);

    } else {

    $(this).prop(“checked”, false);

    $(this).parents(‘tr’).removeClass(“active”);

    }

    });

    jQuery.uniform.update(set);

    });

     

    tableReservedLoans.on(‘change’, ‘tbody tr .checkboxes’, function () {

    $(this).parents(‘tr’).toggleClass(“active”);

    });

    • This topic was modified 2 years, 7 months ago by  rsquarev.
    Sean
    Sean
    Keymaster

    Posts: 4481
    Support Staff Reply #3429

    Hi,

    Did you check and debug your page of JS errors that may cause this issue ? If possible can you provide us a test link to your site in a private reply ?

    Thanks.


    rsquarev
    Participant

    Posts: 15
    Member Reply #3433
    This reply has been marked as private.
    Sean
    Sean
    Keymaster

    Posts: 4481
    Support Staff Reply #3447

    Hi,

    I checked your HTML template and  it seems you commented out App.init() and Layout.init() core initialization functions:

    <SCRIPT>
    jQuery(document).ready(function () {
    //App.init(); // init metronic core components
    //Layout.init(); // init current layout
    });
    </SCRIPT>

    Please try to uncomment the above functions since they are used to initialize core plugins and layout functions.

    Thanks.


    rsquarev
    Participant

    Posts: 15
    Member Reply #3475

    There is no change with uncomment

    Sean
    Sean
    Keymaster

    Posts: 4481
    Support Staff Reply #3506

    Hi,

    It looks like we will need to check your working page from a test link. Could you please try to deploy it to your test server and provide us the link in a private reply ? Otherwise we will not be able to detect the issue since this is not a general bug. Most likely the issue is related to your custom code.

    Thanks.


    rsquarev
    Participant

    Posts: 15
    Member Reply #3535

    Okay, That’s not possible for now. I will close the issue for now.

    Sean
    Sean
    Keymaster

    Posts: 4481
    Support Staff Reply #3546

    Noted. Please let us know if we will be able to check your site remotely.

You must be logged in to reply to this topic.