Hide Table Column
$('#table-name th:nth-child(column-no)').hide();
$('#table-name td:nth-child(column-no)').hide();
$('#tblService th:nth-child(4)').hide();
$('#tblService td:nth-child(4)').hide();
Print All columns of each row
var table = $("#tblBody");
table.find('tr').each(function (i)
{
var
$tds = $(this).find('td');
alert ($tds.eq(0).text() + " , " + $tds.eq(1).text())
});
Print All Row columns except first
var table = $("#tblBody");
table.find('tr').not(':first').each(function (i)
{
var $tds = $(this).find('td');
alert ($tds.eq(0).text() + " , " + $tds.eq(1).text())
});
Get selected column data using rowid
Syntax:
$("RowId”).find('td').eq(ColumnIndex).text();
$("#r123”).find('td').eq(0).text();
Delete a Single row by row id
Syntax:
$("RowId”).remove();
Example :
Example :
$("#tblrow").remove();
Delete all row except first
Syntax:
$("selectorName").find("tr:gt(0)").remove();
Example :
$("#tblStock").find("tr:gt(0)").remove();
No comments:
Post a Comment