This repository has been archived by the owner on May 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
insert()
Karl edited this page Sep 3, 2017
·
5 revisions
Insert new data in to the table.
/**
* @param {object} data New data to insert
* @return {void}
*/
datatable.insert(data);
var newData = [
{
"Heading 1": "Cell 1",
"Heading 2": "Cell 2",
"Heading 3": "Cell 3",
"Heading 4": "Cell 4",
},
{
"Heading 1": "Cell 5",
"Heading 2": "Cell 6",
"Heading 3": "Cell 7",
"Heading 4": "Cell 8",
}
];
datatable.insert(newData);
var newData = {
headings: [
"Name",
"Position",
"Town",
"Ext.",
"Start Date",
"Salary"
],
data: [
[
"Cedric Kelly",
"Senior Javascript Developer",
"Edinburgh",
"6224",
"2012/03/29",
"$433,060"
],
[
"Airi Satou",
"Accountant",
"Tokyo",
"5407",
"2008/11/28",
"$162,700"
],
...
]
};
// add the rows
dataTable.insert(newData);
If you attempt to pass new headings to a table that has headings, they'll be ignored.
- datatable.init
- datatable.refresh
- datatable.update
- datatable.page
- datatable.sort
- datatable.perpage
- datatable.search
- perPage
- perPageSelect
- nextPrev
- prevText
- nextText
- firstLast
- firstText
- lastText
- searchable
- sortable
- truncatePager
- fixedColumns
- fixedHeight
- columns
- data
- ajax
- labels
- layout
- header
- footer
- table
- head DEPRECATED
- body DEPRECATED
- foot DEPRECATED
- wrapper
- container
- pagers
- headings
- options DEPRECATED
- initialized
- isIE DEPRECATED
- data
- activeRows DEPRECATED
- dataIndex
- pages
- hasRows
- hasHeadings
- currentPage
- totalPages
- onFirstPage
- onLastPage
- searching
- searchData