fnUpdate Error in IE: htmlfile. Unknown Runtime Error
fnUpdate Error in IE: htmlfile. Unknown Runtime Error
newblord
Posts: 2Questions: 0Answers: 0
Im trying to implement the crud editable dataTable. When i click save and the function tries to use fnUpdate i get an error.
[code]
function saveRow(oTable, nRow) {
var $jqInputs = $('input', nRow);
oTable.fnUpdate($jqInputs[0].value, nRow, 0, false);
oTable.fnUpdate($jqInputs[1].value, nRow, 1, false);
oTable.fnUpdate('Edit', nRow, 2, false);
oTable.fnDraw();
oTable.fnSetColumnVis(2, false);
oTable.fnSetColumnVis(3, false);
$vendor_counter++;
editMode = false;
save = true;
var aiNew = oTable.fnAddData(['', '',
'Edit', 'Delete']);
}
[/code]
I also ran into another problem with IE and innerHTML.
[code]
function editRow ( oTable, nRow )
{
var aData = oTable.fnGetData(nRow);
var jqTds = $('>td', nRow);
jqTds[0].innerHTML = '';
jqTds[1].innerHTML = '';
jqTds[2].innerHTML = '';
jqTds[3].innerHTML = '';
jqTds[4].innerHTML = '';
jqTds[5].innerHTML = 'Save';
}
[/code]
That was the code posted by allan.
This is the workaround i found that works for IE.
[code]
function editRow(oTable, nRow) {
var aData = oTable.fnGetData(nRow);
var jqTds = $('td', nRow);
jqTds[0].id = "test";
$("#test").html("");
jqTds[0].id = "";
jqTds[1].id = "test";
$("#test").html("");
jqTds[1].id = "";
jqTds[2].id = "test";
$("#test").html("Save");
jqTds[2].id = "test";
editMode = true;
}
[/code]
Please help me out here i need to get this done asap for a project and im running out of time.
[code]
function saveRow(oTable, nRow) {
var $jqInputs = $('input', nRow);
oTable.fnUpdate($jqInputs[0].value, nRow, 0, false);
oTable.fnUpdate($jqInputs[1].value, nRow, 1, false);
oTable.fnUpdate('Edit', nRow, 2, false);
oTable.fnDraw();
oTable.fnSetColumnVis(2, false);
oTable.fnSetColumnVis(3, false);
$vendor_counter++;
editMode = false;
save = true;
var aiNew = oTable.fnAddData(['', '',
'Edit', 'Delete']);
}
[/code]
I also ran into another problem with IE and innerHTML.
[code]
function editRow ( oTable, nRow )
{
var aData = oTable.fnGetData(nRow);
var jqTds = $('>td', nRow);
jqTds[0].innerHTML = '';
jqTds[1].innerHTML = '';
jqTds[2].innerHTML = '';
jqTds[3].innerHTML = '';
jqTds[4].innerHTML = '';
jqTds[5].innerHTML = 'Save';
}
[/code]
That was the code posted by allan.
This is the workaround i found that works for IE.
[code]
function editRow(oTable, nRow) {
var aData = oTable.fnGetData(nRow);
var jqTds = $('td', nRow);
jqTds[0].id = "test";
$("#test").html("");
jqTds[0].id = "";
jqTds[1].id = "test";
$("#test").html("");
jqTds[1].id = "";
jqTds[2].id = "test";
$("#test").html("Save");
jqTds[2].id = "test";
editMode = true;
}
[/code]
Please help me out here i need to get this done asap for a project and im running out of time.
This discussion has been closed.
Replies