adding row prompt warning
adding row prompt warning
knvb
Posts: 4Questions: 1Answers: 0
I am preparing user management table.
I got warning when I add a row.
I found that if I remove "data-order" from the first column, it warning message gone.
How can I fixed the problem?
Here is my code:
<table id="userTable" class="display">
<thead>
<tr>
<th>User Name:</th>
<th>Password:</th>
<th align=center>Directory Access:</th>
<th>Enabled</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td data-order="0,1000"><input type=hidden id="userName0" readonly style="border:none" value="anonymous">anonymous</td>
<td></td>
<td align=center><a href="javascript:void(0)" onclick="addDirAccess(0)">✚</a></td>
<td><input value="1" type=checkbox id="isUserEnable0"></td>
<td></td>
</tr>
<tr>
<td data-order="1"><input type=hidden id="userName0" readonly style="border:none" value="anonymous">abc</td>
<td></td>
<td align=center><a href="javascript:void(0)" onclick="addDirAccess(0)">✚</a></td>
<td><input value="1" type=checkbox id="isUserEnable0"></td>
<td></td>
</tr>
<tr>
<td><input type=hidden id="userName0" readonly style="border:none" value="anonymous">ab</td>
<td></td>
<td align=center><a href="javascript:void(0)" onclick="addDirAccess(0)">✚</a></td>
<td><input value="1" type=checkbox id="isUserEnable0"></td>
<td></td>
</tr>
<tr>
<td>stamn</td>
<td></td>
<td align=center><a href="javascript:void(0)" onclick="addDirAccess(0)">✚</a></td>
<td><input value="1" type=checkbox id="isUserEnable0"></td>
<td></td>
</tr>
<tr>
<td>tmchan</td>
<td><input type=password id="password1"></td>
<td align=center><a href="javascript:void(0)" onclick="addDirAccess(1)">✚</a></td>
<td><input value="1" type=checkbox id="isUserEnable1"></td>
<td style="font-size:30px">🗑</td>
</tr>
</tbody>
</table>
<script>
var userTable;
$(document).ready(function()
{
userTable=$('#userTable').DataTable(
{
"dom": '<"toolbar">frtip',
"CaseSensitive":true,
"order": [[ 1, "asc" ]],
paging: false,
"info": true,
"orderCellsTop": true,
"fixedHeader":true,
"columnDefs": [{"className": "dt-center", "targets": 2}]
});
$("div.toolbar").html("<a onclick='addRow()'> ✚</a>");
/*var a=document.createElement("a");
a.innerHTML="✚";
$(a).insertBefore($("#userTable").prev());*/
});
function addRow()
{
userTable.row.add(["<input type=\"text\">","<input type=text>","✚","<input type=checkbox>","➖"]).draw(false);
userTable.order([1, 'asc']).draw();
userTable.page('last').draw(false);
}
</script>
This discussion has been closed.