dom - Add an ID to first tr in jquery datatables -
var row = [teams[i].team_id, teams[i].team_name,...]; var = otable.fnadddata(row);
i'm using jquery datatables , adding teams data datatables in above mentioned way, need first column auto increment one(i'll use loop), want add team_id
id
tr
element carries auto-incremented value in first column.
how add "id" tr
while datatable populated.
i need output <tr id="[team_id]">1</tr>
by including dt_rowid property on data source object, automatically create table row id without code whatsoever
for example, ajax source:
{ "secho": 1, "itotalrecords": "57", "itotaldisplayrecords": "57", "aadata": [ { "dt_rowid": "row_7", "dt_rowclass": "gradea", "0": "gecko", "1": "firefox 1.0", "2": "win 98+ / osx.2+", "3": "1.7", "4": "a" },
docs: http://datatables.net/release-datatables/examples/server_side/ids.html
note dt_rowid case sensitive, alias database queries proper capitalization necessary
Comments
Post a Comment