Uncaught TypeError : Cannot read property 'mData' of undefined
Uncaught TypeError : Cannot read property 'mData' of undefined
doodlekana
Posts: 4Questions: 0Answers: 0
This is mvc 4 application with razor view. I made sure only single instance of jquery is loaded. BTW is jquery 1.9.0 compatible with dataTables 1.1 beta? This is my first time using dataTable.
[code]
head1
head2
head3
head4
@foreach (var item in Model)
{
@item.data1
@item.data2
@item.data3
@item.data4
}
$(document).ready(function () {
$("#studenttable").dataTable();
}
)
[/code]
[code]
head1
head2
head3
head4
@foreach (var item in Model)
{
@item.data1
@item.data2
@item.data3
@item.data4
}
$(document).ready(function () {
$("#studenttable").dataTable();
}
)
[/code]
This discussion has been closed.
Replies
Yes. jQuery 1.7+.
Regarding the issue, please link to a test case showing the issue so I can debug it and help to resolve it.
Allan
See the "Prerequisites" section here: http://datatables.net/usage/
Allan
Hola que tal, yo tambien tengo el mismo problema, como podría solucionarlo, ayuda!
<asp:ListView ID="lvDatos" runat="server" DataKeyNames="espe_id" OnItemCommand="lvDatos_ItemCommand">
<LayoutTemplate>
<table id="grid" class="table table-condensed table-bordered table-hover">
<thead>
<tr>
<th>
#
</th>
<th>
NOMBRE DE LA ESPECIALIDAD
</th>
<th>
SIGLA
</th>
<th>
CLAVE
</th>
<th class="hide">
ID COORD
</th>
<th>
COORDINACION
</th>
<th colspan="2">
</th>
</tr>
</thead>
<tbody>
<tr runat="server" id="itemPlaceholder" />
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td>
<%# Container.DataItemIndex + 1 %>
</td>
<td>
<asp:Literal ID="ltlNombreEspecialidad" runat="server" Text='<%# Eval("espe_nombre")%>' />
</td>
<td>
<asp:Literal ID="ltlSiglaEspecialidad" runat="server" Text='<%# Eval("espe_sigla")%>' />
</td>
<td>
<asp:Literal ID="ltlClaveEspecialidad" runat="server" Text='<%# Eval("espe_clave")%>' />
</td>
<td class="hide">
<asp:Literal ID="ltlIdCoordinacion" runat="server" Text='<%# Eval("coord_id")%>' />
</td>
<td>
<asp:Literal ID="ltlNombreCoordinacion" runat="server" Text='<%# Eval("coord_nombre")%>' />
</td>
<td class="actions">
<asp:LinkButton ID="linkEditar" runat="server" CssClass="btn btn-info btn-small pull-right"
title="Editar elemento" CommandName="cmdEditar"><i class="icon-edit icon-white"></i> Editar</asp:LinkButton>
</td>
<td class="actions">
<asp:LinkButton ID="linkBorrar" runat="server" CssClass="btn btn-danger btn-small pull-right"
title="Borrar elemento" CommandName="cmdBorrar"><i class="icon-trash icon-white"></i> Borrar</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:ListView>
$(document).ready(function () {
$('#grid').dataTable({
"scrollY": "200px",
"scrollCollapse": true,
"paging": false
});
});