1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
function fnClickAddRow()
{
if (newVersion == true ) {
var mesOptions = '';
for (var i=0; i< tabProjet.length;i++) {
mesOptions+="<option value='" + tabProjet[i][0] + "'>" + tabProjet[i][1] + "</option>";
}
var mesInput = '<tr>';
for (var i=0;i<10;i++)
{
if (i==1) mesInput += '<td><input type="text" size="15" id="idinput' + idinput +'" onchange="calc();"></td>';
else if (i==0) {
mesInput += '<td><input type="text" size="15" id="idinput' + idinput +'" onchange="calc();"></td>';
}
else if ((i==2) || (i==3) || (i==4) || (i==5)) mesInput += '<td><input type="text" size="7" value ="0" id="idinput' + idinput +'" onchange="calc();"></td>';
else if (i==7) mesInput+= '<td><select id="idinput' + idinput + '"onchange="calc();"><option selected="selected" value="EUR">EUR</option><option value="USD">USD</option><option value="GBP">GBP</option><option value="CAD">CAD</option></select></td>';
else if (i==8) mesInput += '<td><input type="text" size="7" value="1" id="idinput' + idinput +'" onchange="calc();"></td>';
else if (i==6) mesInput+= '<td><select id="idinput' + idinput + '"onchange="calc();"><option value="0" selected="selected">(None)</option>"' + mesOptions + '"</select></td>';
else mesInput += '<td><input type="text" size="7" id="idinput' + idinput +'" onchange="calc();"></td>';
idinput++;
}
mesInput += '</tr>';
$('#example').append(mesInput);
try
{
var monDate = idinput -10;
//var $j = jQuery.noConflict();
$('#idinput'+monDate).datepicker();
}
catch(err)
{
txt="There was an error on this page.\n\n";
txt+="Error description: " + err.message + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
//$('#idinput0').datepicker();
}
else {
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
oTable.fnAddData( [month + "/" + day + "/" + year," ","0","0","0","0"," ","EUR","1","0"] );
ApplyJEditable();
saveData();
}
} |
Partager