File: columns.name.xml

package info (click to toggle)
datatables.js 1.11.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 22,848 kB
  • sloc: javascript: 65,075; xml: 10,712; php: 4,741; sh: 544; makefile: 18
file content (46 lines) | stat: -rw-r--r-- 1,829 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="columns">
	<name>columns.name</name>
	<summary>Set a descriptive name for a column</summary>
	<since>1.10</since>

	<type type="string" />

	<description>
    When working with DataTables' API, it is very common to want to be able to address individual columns so you can work with them (you wish to sum the numeric content of a column for example). DataTables has two basic methods of addressing columns:

    * As a column index (automatically assigned when the table is initialised)
    * With a name - assigned using this option!

    This can make working with columns in the API very easy - for example to access the data from the column named `string location` you would use `table.column( 'location:name' ).data()` - append the string `-string :name` to indicate to DataTables that it should perform a column name selector operation. For more information about column selectors, please see the `dt-api column()` documentation.
	</description>

	<example title="Setting column names with `dt-init columnDefs`"><![CDATA[
$('#example').dataTable( {
  "columnDefs": [
    { "name": "engine",   "targets": 0 },
    { "name": "browser",  "targets": 1 },
    { "name": "platform", "targets": 2 },
    { "name": "version",  "targets": 3 },
    { "name": "grade",    "targets": 4 }
  ]
} );
]]></example>

	<example title="Setting column names with `dt-init columns`"><![CDATA[
$('#example').dataTable( {
  "columns": [
    { "name": "engine" },
    { "name": "browser" },
    { "name": "platform" },
    { "name": "version" },
    { "name": "grade" }
  ]
} );
]]></example>

  <related type="api">column()</related>
  <related type="api">columns()</related>
  <related type="api">column().index()</related>
  <related type="api">columns().indexes()</related>
</dt-option>