Input datepicker in hidden row information

Input datepicker in hidden row information

ifloridoiflorido Posts: 2Questions: 0Answers: 0
edited November 2013 in General
Hello ,

I'm trying to create a field that displays a calendar ( datepicker )
the field is in a hidden row information .

I tried the options out there in the forum but I have worked no , I show the code that I have now, I deleted all the tests I did .

part of the hidden row information

[code]
/* Formating function for row details */
function fnFormatDetails ( oTable, nTr )
{
var aData = oTable.fnGetData( nTr );
var sOut = '';
sOut +='';
sOut +='Fecha Inicio';
sOut +='Fecha Final';
sOut +='';
sOut += '';
sOut +='';
sOut +='';
sOut += '';
return sOut;
}

$(document).ready(function() {
/*
* Insert a 'details' column to the table
*/
var nCloneTh = document.createElement( 'th' );
var nCloneTd = document.createElement( 'td' );
nCloneTd.innerHTML = '';
nCloneTd.className = "center";


$('#table_t_reservas thead tr').each( function () {
this.insertBefore( nCloneTh, this.childNodes[0] );
} );

$('#table_t_reservas tbody tr').each( function () {
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );
} );

/*
* Initialse DataTables, with no sorting on the 'details' column
*/
var oTable = $('#table_t_reservas').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bFilter": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ],
"bVisible": false, "aTargets": [ 7,8,9,10,11,12,17 ]}
],
"aaSorting": [[1, 'asc']]
});

$('#table_t_reservas tbody td img').live('click', function () {
var nTr = $(this).parents('tr')[0];
if ( oTable.fnIsOpen(nTr) )
{
/* This row is already open - close it */
this.src = "images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
this.src = "images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
}
} );
} );
[/code]

I'm trying to start_date and end_date show a calendar when you click on the field.

I tried with

[code]
$(function() {
$( "#start_date" ).datepicker();
});
[/code]

and

[code]
$(function() {
$( "#end_date" ).datepicker();
});
[/code]

but It don´t work

What i need to the script to make it work?

Thank you very much,

Replies

This discussion has been closed.