my DataTable.js not applying order or icons

my DataTable.js not applying order or icons

CarlaBongiovanCarlaBongiovan Posts: 1Questions: 1Answers: 0

My DataTable.js:
$(document).ready(function () {
MakeDataTable();
});

function MakeDataTable() {
$('#tableMatriculados').DataTable(
{
"language": {
"lengthMenu": "Mostrar MENU registros por página",
"zeroRecords": "No se encontraros registros",
"info": "Mostrando página PAGE de PAGES",
"infoEmpty": "No se encontraros registros",
"infoFiltered": "(filtrados de MAX registros)",
"search": "Buscar en los resultados:",
"paginate": {
"previous": "Anterior",
"next": "Siguiente"
}
},
"order": [[1, "asc"]],
"responsive": "true",
"pageLength": 50

    }
);
$('#tableRComprobantes').DataTable(
    {
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5',
            {
                extend: 'print',
                message: 'DO NOT DISTRIBUTE'
            },
        ],
        "pagingType": "full_numbers",
        "pageLength": 25,
        "lengthChange": true,
        "searching": true,
        "ordering": true,
        "order": [[ 1, "asc" ], [ 3, "asc" ]],
        "info": true,
        "autoWidth": true
    }
);

}

function hideOverlay() {
var overlay = document.getElementsByClassName("overlay")[0];
var tableResults = document.getElementById("tableResults");
var overlayText = document.getElementsByClassName("overlay-text")[0];

tableResults.style.display = "block";
overlay.style.display = "none";
overlayText.style.display = "none";

}

function showOverlay() {
//Deshabilito la grilla
var overlay = document.getElementsByClassName("overlay")[0];
var tableResults = document.getElementById("tableResults");
var overlayText = document.getElementsByClassName("overlay-text")[0];
tableResults.style.display = "none";
overlay.style.display = "block";
overlayText.style.display = "flex";
}
From where i call:
@model WebLitoralGas.Models.ReimpresionBoletasModel
@using ClientDependency.Core.Mvc;

@{
Html.RequiresCss("~/css/rboletas.css", 33);
Html.RequiresCss(@"https://cdn.datatables.net/v/bs4/dt-1.10.18/b-1.5.6/b-html5-1.5.6/r-2.2.2/datatables.min.css", 34);

Html.RequiresJs(@"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js", 30);
Html.RequiresJs(@"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js", 31);
Html.RequiresJs(@"https://cdn.datatables.net/v/bs4/dt-1.10.18/b-1.5.6/b-html5-1.5.6/r-2.2.2/datatables.min.js", 32);

Html.RequiresJs("~/scripts/DataTable.js", 35);

Html.RequiresJs(@"http://ajax.aspnetcdn.com/ajax/jquery.validate/1.15.1/jquery.validate.js", 34);
Html.RequiresJs(@"http://ajax.aspnetcdn.com/ajax/mvc/5.2.3/jquery.validate.unobtrusive.js", 35);
Html.RequiresJs(@"https://cdn.jsdelivr.net/jquery.ajax.unobtrusive/3.2.4/jquery.unobtrusive-ajax.min.js", 36);

}

@Html.Raw(Html.RenderCssHere())
@Html.Raw(Html.RenderJsHere())

@using (Ajax.BeginForm("Submit", "ReimpresionBoletas", new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "container", OnFailure = "", OnBegin = "showOverlay();MakeDataTable();", OnSuccess = "hideOverlay();MakeDataTable();" }, new { id = "RComprobantes" })) { @Html.AntiForgeryToken()

Titular: @Model.Titular

Domicilio: @Model.Direccion

@foreach (var x in Model.Comprobantes) { }
Nro.Comprobante Tipo Vencimiento Importe Período
@x.Numero @x.DescTipoComprobante @x.FecVenc.Date.ToString("dd/MM/yyyy") $@x.Importe @x.Periodo.Replace(" ", "")
}

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @CarlaBongiovan ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.