Links on columns disappear (maybe is a bug)
Links on columns disappear (maybe is a bug)
tgp
Posts: 13Questions: 0Answers: 0
Hi Allan,
I try a very simple table with only 4 columns, 3 columns has data from mysql and the 4 column has "Links to show/edit/delete" . Everything works fine but when I hide column 1, 2 or 3 the links on the column 4 disappear on the datatable but if I see the page source there are the links. I try datatables version 1.5.3, 1.7beta3 and I try to disable JqueryUI.
Here is the code I use:
[code]
//<![CDATA[
oTable = $('#categorias').dataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
var $cell=$('td:eq(2)', nRow);
$cell.text(ellipsis($cell.text(),88));
return nRow;
},
"sPaginationType": "full_numbers",
"bProcessing": true,
"bStateSave": false,
"iCookieDuration": 1000,
"bAutoWidth": false,
"bLengthChange": false,
"aaSorting": [[ 1, "asc" ]],
"iDisplayLength": 10,
"aoColumns": [
{ "sType": "natural", "bSearchable": false, "bSortable": true, "bVisible": true, "bFilter": true, "sClass": "ajaxlink", "sWidth": "2px"},
{ "sType": "natural", "bSearchable": false, "bSortable": true, "bVisible": true, "bFilter": false, "sClass": "ajaxlink", "sWidth": "2px"},
{ "sType": "natural", "bSearchable": true, "bSortable": true, "bVisible": true, "bFilter": true, "sClass": "ajaxlink", "sWidth": "2px"},
{ "bSearchable": false, "bSortable": false, "bVisible": true, "bFilter": false, "sClass": "acciones", "sWidth": "30px"}
],
"bJQueryUI": true,
"oLanguage": {
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sInfo": "Mostrando desde _START_ hasta _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ registros en total)",
"sSearch": "Buscar en todo:",
"oPaginate": {
"sFirst": "Primero",
"sPrevious": "Anterior",
"sNext": "Siguiente",
"sLast": "Último"
}
},
"fnDrawCallback": function() {
$("#categorias tbody tr").click(function () {
var nTds = $('td', this);
var id = $(nTds[0]).text();
window.location.href = "editar/"+id;
} );
}
});
$("tfoot input").keyup( function () {
var columna =
oTable.fnFilter( this.value, $("tfoot input").index(this));
} );
var asInitVals = new Array();
$("tfoot input").each( function (i) {
asInitVals[i] = this.value;
} );
$("tfoot input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("tfoot input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
} );
} );
//]]>
[/code]
[code]
id_categoria
nombre_categoria
descripcion_categoria
Acciones
2
ñañaña
ñañaña
VerEditarEliminarTEST
1
ñañaa
klklsidllsdks
VerEditarEliminarTEST
[/code]
Can you help me?
Thanks
I try a very simple table with only 4 columns, 3 columns has data from mysql and the 4 column has "Links to show/edit/delete" . Everything works fine but when I hide column 1, 2 or 3 the links on the column 4 disappear on the datatable but if I see the page source there are the links. I try datatables version 1.5.3, 1.7beta3 and I try to disable JqueryUI.
Here is the code I use:
[code]
//<![CDATA[
oTable = $('#categorias').dataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
var $cell=$('td:eq(2)', nRow);
$cell.text(ellipsis($cell.text(),88));
return nRow;
},
"sPaginationType": "full_numbers",
"bProcessing": true,
"bStateSave": false,
"iCookieDuration": 1000,
"bAutoWidth": false,
"bLengthChange": false,
"aaSorting": [[ 1, "asc" ]],
"iDisplayLength": 10,
"aoColumns": [
{ "sType": "natural", "bSearchable": false, "bSortable": true, "bVisible": true, "bFilter": true, "sClass": "ajaxlink", "sWidth": "2px"},
{ "sType": "natural", "bSearchable": false, "bSortable": true, "bVisible": true, "bFilter": false, "sClass": "ajaxlink", "sWidth": "2px"},
{ "sType": "natural", "bSearchable": true, "bSortable": true, "bVisible": true, "bFilter": true, "sClass": "ajaxlink", "sWidth": "2px"},
{ "bSearchable": false, "bSortable": false, "bVisible": true, "bFilter": false, "sClass": "acciones", "sWidth": "30px"}
],
"bJQueryUI": true,
"oLanguage": {
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sInfo": "Mostrando desde _START_ hasta _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ registros en total)",
"sSearch": "Buscar en todo:",
"oPaginate": {
"sFirst": "Primero",
"sPrevious": "Anterior",
"sNext": "Siguiente",
"sLast": "Último"
}
},
"fnDrawCallback": function() {
$("#categorias tbody tr").click(function () {
var nTds = $('td', this);
var id = $(nTds[0]).text();
window.location.href = "editar/"+id;
} );
}
});
$("tfoot input").keyup( function () {
var columna =
oTable.fnFilter( this.value, $("tfoot input").index(this));
} );
var asInitVals = new Array();
$("tfoot input").each( function (i) {
asInitVals[i] = this.value;
} );
$("tfoot input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("tfoot input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
} );
} );
//]]>
[/code]
[code]
id_categoria
nombre_categoria
descripcion_categoria
Acciones
2
ñañaña
ñañaña
VerEditarEliminarTEST
1
ñañaa
klklsidllsdks
VerEditarEliminarTEST
[/code]
Can you help me?
Thanks
This discussion has been closed.