Error 'mData' javascript

Asked

Viewed 35 times

0

I need some help from you.

When I enter this screen.

@model IEnumerable<Basics.Domain.Entities.Randomizacao>

@{
    ViewBag.Title = "Detalhes";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var hospital = Model.First().Hospital != null ? Model.First().Hospital.Nome : "Não alocado";
    var isHomolog = Request.Url.AbsoluteUri.Contains("homolog") || Request.Url.AbsoluteUri.Contains("localhost") ? true : false;
}

<a href="@Url.Action("Index", "Randomizacao", new { area = "Gerencial" })" class="btn btn-primary" style="margin-bottom: 20px;"><i class="glyphicon glyphicon-chevron-left"></i> Voltar</a>

<div class="container jumbotron">
    <div class="form-group">
        <table id="dataTable" data-filter="" class="form celled table">
            <tr>
                <th>
                    Lista
                </th>
                <th>
                    Posição
                </th>
                <th>
                    Hospital
                </th>
                <th>
                    Paciente
                </th>
                <th>
                    Medicação
                </th>
                <th>
                    Velocidade
                </th>
                @if (isHomolog)
                {
                    <th>
                        Editar
                    </th>
                }
            </tr>

            @foreach (var item in Model)
            {
                var paciente = "Não alocado";

                if (item.PatientId != null)
                {
                    var cadastroService = new Basics.Services.Services.Formulario.CadastroService();
                    var cadastro = cadastroService.GetByPatientId(int.Parse(item.PatientId.ToString()), item.Hospital.CentroId);
                    if (cadastro != null)
                    {
                        paciente = cadastro.inpac;
                    }
                }

                <tr>
                    <td>
                        @item.RandomizacaoLista
                    </td>
                    <td>
                        @item.RandomizacaoOrdem
                    </td>
                    <td>
                        @hospital
                    </td>
                    <td>
                        @paciente
                    </td>
                    <td>
                        @item.Medicacao
                    </td>
                    <td>
                        @item.Velocidade
                    </td>
                    @if (isHomolog)
                    {
                        if (item.RandomizacaoData != null)
                        {
                            <td>
                                <a href="@Url.Action("Editar", "Randomizacao", new { PatientId = item.PatientId })">Editar</a>
                            </td>
                        }
                        else
                        {
                            <td>
                                <span>Indisponível</span>
                            </td>
                        }
                    }
                </tr>
            }
        </table>
    </div>
</div>

this error appears in my browser

Uncaught Typeerror: Cannot read Property 'mData' of Undefined

someone could help me?

inserir a descrição da imagem aqui

_Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="~/Content/Imagens/favicon.ico" alt="NovaTela BaSICS" />
    <title>@ViewBag.Title - BaSICS</title>
    <link href="~/Content/Site.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/modernizr-2.6.2.js"></script>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
    <style>
        .renderBody{
            margin-top: 2%;
        }
    </style>
</head>
<body>
    <div class="container body-content renderBody">
        @RenderBody()
        <hr />
        <footer>
            Desenvolvido por <a href="http://www.novatela.com.br/" target="_blank">NovaTela Solutions</a> &copy; # 2009 - @DateTime.Now.Year # Todos os direitos reservados.
        </footer>
    </div>

</body>
</html>
  • And where is your javascript?

  • @Leandroangelo I just edited the post and put my _Layout.cshtml that is from there it comes

  • I refer to the view javascript

  • No javascript in this view

  • But you intend to use Jquery’s datatable??? <table id="dataTable" data-filter="" class="form celled table">

  • how do I tidy up?

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.