X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fexamples%2Fapi%2Fadd_row.html;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fexamples%2Fapi%2Fadd_row.html;h=295d299a0979b62a00a4ea1736d4b5ec3373d721;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/examples/api/add_row.html b/webapp/resources/datatables-1.9.4/examples/api/add_row.html new file mode 100644 index 0000000..295d299 --- /dev/null +++ b/webapp/resources/datatables-1.9.4/examples/api/add_row.html @@ -0,0 +1,221 @@ + + + + + + + DataTables example + + + + + + +
+
+ DataTables add row example +
+ +

Preamble

+

DataTables adding rows in DataTables is done by assigning the DataTables jQuery object to a variable when initialising it, and then using it's API methods to add a new row. Deleting rows can be done in a similar manner.

+ +

Live example

+

Click to add a new row

+ +
+ + + + + + + + + + + + + + + + + +
Column 1Column 2Column 3Column 4
allanallanallanallan
+
+
+ + +

Initialisation code

+
/* Global var for counter */
+var giCount = 1;
+
+$(document).ready(function() {
+	$('#example').dataTable();
+} );
+
+function fnClickAddRow() {
+	$('#example').dataTable().fnAddData( [
+		giCount+".1",
+		giCount+".2",
+		giCount+".3",
+		giCount+".4" ] );
+	
+	giCount++;
+}
+ + + + +

Other examples

+ + + + + + +
+ + \ No newline at end of file