Datatablesначало работы с данными

Description

DataTables will add a number of elements around the table to both control the table and show additional information about it. The position of these elements on screen are controlled by a combination of their order in the document (DOM) and the CSS applied to the elements. This parameter is used to control their ordering and additional mark-up surrounding them in the DOM.

Each table control element in DataTables has a single letter associated with it, and that letter it used in this configuration option to indicate where that element will appear in the document order.

Options

The built-in table control elements in DataTables are:

  • — ength changing input control
  • — iltering input
  • — The able!
  • — Table nformation summary
  • — agination control
  • — pocessing display element

Each option can be specified multiple times (with the exception of the table itself), which can be used to have table controls both above and below the table. DataTables will automatically synchronise these multiple controls.

In addition to the above control options, there are two constants DataTables understands (note that these two options are deprecated in 1.10 and will be removed in 1.11 along side the separation of the option into its own theme file):

  • — jQueryUI theme «header» classes ()
  • — jQueryUI theme «footer» classes ()

Markup

Further to these options, you can also specify additional elements to be inserted into the document, which can be used for styling / nesting of the control elements. To add tags, the following syntax is expected:

  • and — div element
  • and — div with a class
  • and — div with an ID
  • and — div with an ID and a class

Styling

The styling libraries that DataTables supports will override the default value of the parameter and replace it with a value that is suitable for their layout system. For example the Bootstrap integration makes use of Bootstrap’s grid layout.

The defaults for the styling integrations are:

Bootstrap 3:

Bootstrap 4:

Foundation:

jQuery UI:

Semantic UI:

Plug-ins

DataTables feature plug-ins can be developed to add additional features to DataTables and often will make use of this option, adding new letters to the DataTables core features. For example Buttons adds the option to to specify where table control buttons should be inserted into the table.

The following extensions can be initialised through the option:

  • — Buttons
  • — ColReorder
  • — Scroller
  • — SearchPanes
  • — SearchBuilder

Future development

Note, I am aware that this is the most complex option in DataTables and it takes a fair amount of understanding, particularly when using the styling integration options! The plan is to revamp this option in 1.11 to make it easier to use.

Chaining

Like jQuery, the DataTables API makes extensive use of chaining, with many, but not all, of the DataTables methods returning the API instance itself, so you can immediately call another API method. For example:

This makes use of two different API methods, and , on a single line. It could equally be written as:

The functionality is identical in this case, but chaining can allow for more succinct and expressive code.

Where the DataTables API departs from jQuery’s chaining method is that DataTables makes use of nested methods and properties. For example the method gives you access to the latest JSON data from an Ajax call DataTables has made — in this case the method is a child of the property. Likewise, the (and other data manipulation methods) provide their own chaining child methods. For example . This allows the API to be very expressive in terms of how you access data, with methods relating to what has been called before.

All top level methods of the API will always be available, at all levels of nesting of the API. For example is a top level method, but it can be called after a row is removed from the table: .

Please note that not all methods will return an API instance for chaining. In some cases, returning the API instance for chaining wouldn’t be appropriate, such as to get a / element. The API reference documentation contains full details for each method and what it will return.

Extensions

AutoFill

AutoFill adds an Excel like data fill option to DataTables, allowing click and drag over cells, filling in information and incrementing numbers as needed. Read more »

Buttons

The Buttons extension for DataTables provides a common set of options, API methods and styling to display buttons on a page that will interact with a DataTable. Modules are also provided for data export, printing and column visibility control. Read more »

ColReorder

ColReorder allows the end user to modify the column order of a table through drop-and-drag of column headers. Read more »

Editor

Editor provides full editing abilities for your tables, including multi-row and inline editing. With Editor, creating a fully customised table, where your users can edit the information in the table, couldn’t be easier. Read more »

FixedColumns

FixedColumns «freezes» in place the left most columns in a scrolling DataTable, to provide a guide to the end user (for example an index column). Read more »

FixedHeader

The FixedHeader plug-in will freeze in place the header, footer and left and/or right most columns in a DataTable, ensuring that title information will remain always visible. Read more »

KeyTable

KeyTable provides Excel like cell navigation on any table. Events (focus, blur, action etc) can be assigned to individual cells, columns, rows or all cells. Read more »

Responsive

Responsive will automatically optimise the table’s layout for different screen sizes through the dynamic column visibility control, making your tables useful on desktop and mobile screens. Read more »

RowGroup

RowGroup provides a simple API to visually grouped sets of data in a DataTable. This grouping, which can be dynamically controlled with the API, can be used to provide customised aggregation of data, letting users quickly view a summary of like data. Read more »

RowReorder

RowReorder adds the ability for rows in a DataTable to be reordered through user interaction with the table (click and drag / touch and drag). Integration with Editor’s multi-row editing feature is also available to update rows immediately. Read more »

Scroller

A virtual renderer for DataTables, allowing the table to look like it scrolls for the full data set, but actually only drawing the rows required for the current display, for fast operation. Read more »

SearchBuilder

SearchBuilder adds user defined complex search to the DataTable with the capability to search the DataTable by creating groups and conditions. This offers more advanced search controls than is currently offered by SearchPanes or the core DataTables functionality. It is possible to set logic types for groups and apply a variety of conditions. Read more »

Select

Select adds item selection capabilities to a DataTable. Items can be rows, columns or cells, which can be selected independently, or together. Item selection can be particularly useful in interactive tables where users can perform some action on the table such as editing. Read more »

SearchPanes

SearchPanes adds panes to the DataTable with the capability to search the DataTable by selecting rows in the panes. This is very useful when it comes to adding a more accessible searching feature and custom search capabilities. Read more »

ColVis Retired

ColVis has been retired — please use Buttons. ColVis presents the end user with a list of columns in the table and options to enable or disable their current visibility. Read more »

TableTools Retired

TableTools has been retired — please use Buttons and Select. TableTools adds a toolbar to a table to provide options for saving files, copying to clipboard, or printing the table. Row selection options are also available. Read more »

Terminology

In order to keep the documentation of the API succinct, a number of terms are used to describe, or refer to, aspects of the API. These are defined here:

  • Instance — an instance of the API is a single object instance which refers to a specific set of DataTable tables (i.e. is the the result of ).
  • Result set — the data held by the API instance. DataTables API instances are «array like» in that they hold data in the same way as a plain Javascript array (and thus can be accessed using array notation) and have many of the same methods available ( and for example). This is much in the same way as jQuery is array like in nature.
  • Context — the context of an API instance describes the DataTables that the API instance has a link to. Each API instance can refer to one or more DataTables tables, with the ability to act upon those tables (see below for further information).

Advanced tables, instantly

DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, built upon the foundations of progressive enhancement, that adds all of these advanced features to any HTML table.

Pagination
Previous, next and page navigation.

Instant search
Filter results by text search.

Multi-column ordering
Sort data by multiple columns at once.

Use almost any data source

DOM,
Javascript,
Ajax and
server-side processing.

Easily theme-able

DataTables theme creator,
Bootstrap 3/,
Foundation and
Semantic UI.

Wide variety of extensions

Editor,
Buttons,
Responsive and
more.

Mobile friendly
Tables adapt to the viewport size.

Fully internationalisable
Easily translate DataTables into multiple languages.

Free open source software

MIT license!
Commercial support.

You’re in great company

DataTables is used by people at these fine companies.

Create customised, editable tables in minutes with Editor for DataTables

Save your time writing yet another CRUD application — Editor is a premium extension created to produce complex, fully editable tables that take full advantage of all of the features of DataTables.

21st May 2020

Button’s Excel export does over styling options, but it isn’t particularly trivial to use. Thankfully Paul Jones has put together an excellent resource to help with this though! It shows the code to use for a set of Excel export examples.

Card View

19th Feb 2020

Michael has been at it again (creating useful blog posts about DataTables!). This time discussing a technique originally suggested in the forum for using DataTables with a card view.

Search and order by `input` or `select` elements

19th Feb 2020

Another really useful article by Michael Ryvkin — this time describing how you can use a clever little renderer to search and order live DOM elements.

Server-side processing with CodeIgniter

14th Jan 2020

Samson Luvanda has created and documented a library to enable server-side processing in a CI environment.

SSP with .NET Core — complex filtering

13th Aug 2019

An update to Abdul Rahman’s .NET Core library for DataTables server-side processing has added support for complex filtering and sorting.

CodeIgniter with server-side processing

25th Jul 2019

Iftikhar has written a detailed tutorial on how to use DataTables’ server-side processing with CodeIgniter.

MongoDB server-side processing

13th Jun 2019

David Leon as written an article, and published the corresponding software, on how to use DataTables server-side processing with MongoDB in PHP.

If you are looking for a quick way of creating stylish looking tables, integrated with the rest of your site, then there are a number of themes available on ThemeForest which use DataTables.

Examples

display

Short-hand for , , and .

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

cell-border

Border around all four sides of each cell

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

compact

Reduce the amount of white-space the default styling for the DataTable uses, increasing the information density on screen, as shown below. Note that this style requires DataTables 1.10.1 or newer.

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

hover

Row highlighting on mouse hover

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

nowrap

Disable line wrapping of content in the table cells, so the text will always appear on one line. Note that this style requires DataTables 1.10.1 or newer.

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

order-column

Highlight the ordering column

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

row-border

Border on the rows only

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

stripe

Row striping.

Name Position Office Age Start date Salary
Name Position Office Age Start date Salary
Tiger Nixon System Architect Edinburgh 61 2011/04/25 $3,120
Garrett Winters Director Edinburgh 63 2011/07/25 $5,300
Ashton Cox Technical Author San Francisco 66 2009/01/12 $4,800
Cedric Kelly Javascript Developer Edinburgh 22 2012/03/29 $3,600

Licensing

Q. DataTables is great! How much is it?
A. DataTables is free, open source software that you can download and use for whatever purpose you wish, on any and as many sites you want. It is free for you to use! DataTables is available under the MIT, with which you must comply (to do this, basically keep the copyright notices in the software).

Q. Really — it’s free, even for commercial sites?!
A. Yes! I’m very proud of what has been achieved with DataTables and the fantastic community that has helped it to get to where it is today, and I’m delighted to make it available as open source. Obviously if you benefit from DataTables then any reciprocation is very welcome, be it as a plug-in for DataTables (post your code in the forums), purchasing a supporter package or a blog post saying you enjoy using DataTables.

Q. We can’t use MIT licensed software. What do we do?
A. In the rare case that you can’t use DataTables under its available license, please get in touch to discuss alternative licensing arrangements.

Plural / Singular

When working with the API you will notice that the methods make extensive use of plural and singular terminology. Although this is relatively unusual in an API, it is done to reflect the way that you access the data in the table — for example will return an API instance with the data for the selected rows in its result set (i.e. like an array), while will return the data for just that row. This makes working with the API much more intuitive as you will always get the result you expect.

To be clear, in English (for our international users):

  • Singular === 1
  • Plural > 1

So if you want to use one of the selector methods to select multiple items, use the plural form of the method. If you want to select a single specific item, use the singular form.

Type based sorting

The main DataTables package includes sorting functions for strings, dates, numeric and currency data, but you may very well wish to order data in some other manner, for example date formats not built in. The sorting functions below provide a wealth of different sorting methods that can be used with DataTables.

It is also worth noting that sorting function go hand-in-hand with type detection plug-ins, and many of the sorting plug-ins below has a corresponding type detection function to make installation very easy.

How to use

To add the ability to sort specific data types, using the plug-in functions below, you simply need to include the plug-in’s code in the Javascript available for your page, after you load the DataTables library, but before you initialise the DataTable. Then using the parameter for the column you want to have this sorting type applied to, set it to the value needed for the plug-in (this isn’t needed if you use a type detection plug-ins for the sorting type.

The following example shows how the numeric comma sorting plug-in (saved to a file) can be used with a DataTable, sorting on the fourth column (live example):

Initialising DataTables

That’s almost it! We’ve got the HTML table we want to enhance, and we’ve got all the software and styles we need. All that is now required is to tell DataTables to actually work its magic on the table. This is done with a few lines of Javascript:

If you’ve used jQuery before, you will recognise the form of this script: we wait for the document to be fully ready, and then select the table we want, and run the DataTables function on it.

That’s it! DataTables will add ordering, searching, paging and information to your table by default, giving your end users the ability to find the information they want as quickly as possible.

If you want to customise your DataTable, this can be done by specifying configuration parameters in an object passed to the function. For information on how to use these configuration parameter, please refer to the options manual page.

Description

This property can be used to read and write data to and from any data source property, including deeply nested objects / properties. can be given in a number of different ways which affect its behaviour as documented below.

The data that is resolved for a data point (between this option and ) will be used by DataTables for the requested data, with three special cases:

  • — the same as if not present!
  • — If is used, the data passed to the rendering function will be the original data source for the row. If there is no renderer the value will be used. If there is no default content specified, for display data the source object for that row will be used; will be used for all other data types.
  • — the function will be executed and the returned value used. As of DataTables 1.10.1 the function will be executed in the same scope as the data object for the row. The result of this is that an object instance can be used as the data source for a row.

Note that is both a getter and setter option. If you just require formatting of data for output, you will likely want to use which is simply a getter and thus much simpler to use!

As of DataTables 1.10.3 this option can be used with a DOM sourced data to instruct DataTables where to write the data read for each column to in a data source object. By default DataTables will store the data in an array, but using this option you can provide object property names which describe the structure of the object to use (example).

SearchPanes

Q. SearchPanes won’t configure when using it as a button
A. When configuring SearchPanes using a button the configuration for SearchPanes needs to go within the config property of the button, not in the DataTables configuration. This example shows how to do this.

Q. No Panes are being shown
A. When this happens it is probably because the data in your table is too unique. SearchPanes makes use of a which is used to calculate whether to display a pane for a column or not. To force panes to either hide or show, it is best to make use of the configuration option.

Q. CascadePanes isn’t working / CascadePanes is breaking things
A. is by far the most complicated part of SearchPanes. Unfortunately, with that comes a few edge cases that we are currently unable to support. If you find yourself asking this question it is likely that you are doing any/some of the following, which are not supported.

  • and — This is not supported because in order for cascade to behave as expected the selections need to be made in the correct order. Currently it is not possible to indicate this with preSelect.
  • , and . While SearchPanes and cascade will still run with all of these enabled, the options displayed to the user on a page reload are very unlikely to be as expected. Again, SearchPanes would need to make the selections in the correct order to do this, and the initial request that is sent to the server simply returns the filtered options, leaving no way to determine what order the selections should have been made in.
  • and . When using these together you must make sure that the data in your table is appropriate for the selection that you make. cascade was developed with the default logic in mind, using logic will work in the majority of cases, but it is possible for unexpected results to occur.
  • When loading the SearchPanes options over ajax, but using client side processing, neither or are supported. This is because the data that was initially provided by the user is likely to become innacurate very quickly. This in turn leads to unexpected behaviour.

Column data points

Now that DataTables knows where to get the data for the rows, we need to also tell it where to get the data for each cell in that row — this is done through the option.

Let’s consider again three different data formats, again shown on the left below — only a single row of data is shown in each case (i.e. it is not wrapped in a structure as discussed above for brevity).

As you will be able to see, in each of the three cases, the same data is available for the row, but the structure of the JSON data is different. We use the property to tell DataTables where to get the data for each column.

Like the option discussed above, is typically given as a string that represents the location of the data required in Javascript dotted object notation. It can also be given in other forms such as an index for accessing an array.

The corresponding initialisation of DataTables for the three data structures is shown on the right.

1) Array of data — note that the array option does not require the option to be set. This is because the default value for is the column index (i.e. ):

2) Object of data:

3) Nested objects — in this case note that in the nested objects we use dotted object notation such as to access nested data. With this ability almost any JSON data structure can be used with DataTables:

Built-in helpers

DataTables has two built in rendering helpers that can be used to easily format data — more can be added using plug-ins (see below):

  • — for formatting numbers
  • — to securely display text from a potentially unsafe source (HTML entities are escaped).

The built in rendering helpers can be accessed under the object . They are functions (allowing options to be passed into them) which should be immediately executed and their result assigned to the method. This might sound a little complicated, but it simply means you would use something like the following:

Number helper

The helper provides the ability to easily format, you guessed it, numbers! When dealing with numbers, you may often wish to add formatting such as prefix and postfix characters (currency indicators for example), use a thousands separator and specify a precision for the number. This is all possible with the helper.

The helper function takes up to five optional parameters:

  1. The thousands separator (required)
  2. Decimal separator (required)
  3. Floating point precision — 0 for integers, 1 for a single decimal place, etc (optional)
  4. A prefix string (optional)
  5. A postfix string (optional).

For example, to display the data point from the data structure shown above in the format we would use:

This example doesn’t require the thousands separator, but for larger values such as they would be formatted as .

Note that if the helper encounters a value which is not a valid number (either or that contains a number) it will return the value after escaping any HTML entities in it (to help protect against potential security attacks).

Text helper

The helper will ensure that any potentially dangerous HTML in the source data will not be executed by escaping the HTML entities. This can be useful if the data being loaded may come from a potentially untrusted data source and can help mitigate XSS attacks.

The helper doesn’t take any parameters making its use simply:

Installing Javascript / CSS

The key part of the installation of DataTables is including the DataTables source files on your page. As noted at the top of this page, this simply involves including the DataTables Javascript and CSS files. The CSS file is actually optional, but it provides default styling for your table to make it look good with minimum effort. See the style theme creator if you want to customise the colours of the default DataTables CSS.

The required files can be installed in a number of different ways:

  • Using the DataTables CDN
  • Locally
  • With a package manager such as NPM or Bower.

CDN

A CDN is a Content Delivery Network which has edge servers that are tuned to provide media files with very low latency to web-browsers, and as a user receives a file from the CDN the browser will cache it for reuse. This means that different sites using the same Javascript library can share a large performance improvement since the browser does not need to download the same file from different servers for each site.

The DataTables CDN is powered by CloudFlare which has edge servers all around the world, ensuring that the Javascript and CSS for DataTables can be loaded as quickly as possible by your visitor’s browsers.

To include DataTables on your page simply include the following HTML (remember to include jQuery as well):

Local installation

If you prefer not to use a CDN, and instead have the files hosted on your own server, or if you want to modify the files at all, it is just as simple to get going with DataTables.

Simply use the download builder to download the latest version of DataTables, select any additionally software and styling you want and download the customised package. Then unzip and upload to your web-server. You will then have a directory called available on your server. Then include DataTables on your page using the following HTML:

NPM

DataTables and its extensions are available as NPM packages. The package base name is and the extensions and styling integration options are available as individual packages — see the NPM install guide for full details on the available packages.

For example the following can be used to install DataTables and its default styling:

The DataTables packages all export a factory function that can be executed with two optional arguments — the and jQuery object to use — again see the NPM install guide for details on these parameters. When using Browserify you can simply execute the function without any parameters — e.g.:

Bower

DataTables, its extensions and styling options are also available as Bower packages. The package names are identical to the NPM packages with as the base name. To install DataTables and its default styling via bower use:

Initialising DataTables

That’s almost it! We’ve got the HTML table we want to enhance, and we’ve got all the software and styles we need. All that is now required is to tell DataTables to actually work its magic on the table. This is done with a few lines of Javascript:

If you’ve used jQuery before, you will recognise the form of this script: we wait for the document to be fully ready, and then select the table we want, and run the DataTables function on it.

That’s it! DataTables will add ordering, searching, paging and information to your table by default, giving your end users the ability to find the information they want as quickly as possible.

If you want to customise your DataTable, this can be done by specifying configuration parameters in an object passed to the function. For information on how to use these configuration parameter, please refer to the options manual page.

With the basics of how to get DataTables going under your belt, you might now want to explore some of the other options to enhance your tables further:

Summary

Namespaces

defaults
Initialisation options that can be given to DataTables at initialisation
time.
ext

Extension object for DataTables that is used to provide all extension options.
See DataTable.models.ext for full information about the extension object.

Note that the DataTable.ext object is aliased to jQuery.fn.dataTableExt
through which is may be accessed and manipulated, or jQuery.fn.dataTable.ext.

models
Object models container, for the various models that DataTables has available
to it. These models define the objects that are used to hold the active state
and configuration of the table.
oApi
Reference to internal functions for use by plug-in developers. Note that these
methods are references to internal functions and are considered to be private.
If you use these methods, be aware that they are liable to change between versions
(check the upgrade notes).

Properties

<static> :string
Version string for plug-ins to check compatibility. Allowed format is
a.b.c.d.e where: a:int, b:int, c:int, d:string(dev|beta), e:int. d and
e are optional

Methods

(sSelector, oOpts) → {object}
Perform a jQuery selector action on the table’s TR elements (from the tbody) and
return the resulting jQuery object.
(mData, bRedraw) → {array}
Add a single new row or multiple rows of data to the table. Please note
that this is suitable for client-side processing only — if you are using
server-side processing (i.e. «bServerSide»: true), then to add data, you
must add it to the data source, i.e. the server-side, through an Ajax call.
(bRedraw)
This function will make DataTables recalculate the column sizes, based on the data
contained in the table and the sizes applied to the columns (in the DOM, CSS or
through the sWidth parameter). This can be useful when the width of the table’s
parent element changes (for example a window resize).
(bRedraw)
Quickly and simply clear a table
(nTr) → {int}
The exact opposite of ‘opening’ a row, this function will close any rows which
are currently ‘open’.
(mTarget, fnCallBack, bRedraw) → {array}
Remove a row for the table
(bRemove)
Restore the table to it’s original state in the DOM by removing all of DataTables
enhancements, alterations to the DOM structure of the table and event listeners.
(bComplete)
Redraw the table
(sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive)
Filter the input based on data
(mRow, iCol) → {array|string}
Return an array with the data which is used to make up the table
or string if both row and column are given
(iRow) → {array|node}
Get an array of the TR nodes that are used in the table’s body. Note that you will
typically want to use the ‘$’ API method in preference to this as it is more
flexible.
(nNode) → {int}
Get the array indexes of a particular cell from it’s DOM element
and column index including hidden columns
(nTr) → {boolean}
Check to see if a row is ‘open’ or not.
(nTr, mHtml, sClass) → {node}
This function will place a new row directly after a row which is currently
on display on the page, with the HTML contents that is passed into the
function. This can be used, for example, to ask for confirmation that a
particular record should be deleted.
(mAction, bRedraw)
Change the pagination — provides the internal logic for pagination in a simple API
function. With this function you can have a DataTables table go to the next,
previous, first or last pages.
(iCol, bShow, bRedraw)
Show a particular column
() → {object}
Get the settings for a particular table for external manipulation
(iCol)
Sort the table by a particular row
(nNode, iColumn, fnCallback)
Attach a sort listener to an element for a given column
(mData, mRow, iColumn, bRedraw, bAction) → {int}
Update a table cell or row — this method will accept either a single value to
update the cell with, an array of values with one element for each column or
an object in the same format as the original data source. The function is
self-referencing in order to make the multi column updates easier.
(sVersion) → {boolean}
Provide a common method for plug-ins to check the version of DataTables being used, in order
to ensure compatibility.
(sSelector, oOpts) → {array}

Almost identical to $ in operation, but in this case returns the data for the matched
rows — as such, the jQuery selector used should match TR elements rather than any
decendents. The data returned is the original data array/object that was used to create
the row (or a generated array if from a DOM source).

This method is often useful incombination with $ where both functions are given the
same parameters and the array indexes will match identically.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector