Search
898 results 51-60
Manual
- Field type plug-ins › Bringing it togetherTo use the constructed field type now, simply set the type option of the field configuration object when using fields or add(). The example constructed here is available in the Editor examples.
- Display controllers › Putting it all togetherTo use the new display controller the display option can very simply be set to the name given when attaching the plug-in to the Editor.models.display namespace. The example constructed here is available in the Editor examples.
- ContributingIf you are thinking of contributing code to DataTables, first of all, thank you! All fixes, patches and enhancements to DataTables are very warmly welcomed. In order to keep thing manageable, there are a number of guidelines that should be followed in order to ensure that your modification is included in DataTables as quickly as possible: Make contributions in the DataTables/DataTablesSrc repo for DataTables core. Follow the style of the code in the existing files. They might not be to everyone's tastes, but consistency is key for a mature project like DataTables. DataTables doesn't have a coding standards document, but simple common sense of following the same style as in the existing files is ideal. For example use tabs not spaces (as you will see all source files use tabs). Link to a test page showing the bug you are fixing or the feature you are adding. This allows to me to quickly identify what is being changed and why. Don't worry about being verbose in pull requests - its much better to know exactly what is changing and why! DataTables is a large and complex project and it isn't always possible or suitable to pull in every suggested change. Please don't be offended if a pull request is not merged in, it will explained why not if this is the case. Also it isn't always possible to fully check and test pull requests as quickly as I would like due to other commitments. Again this is no reflection on your pull request, just the busy life that we all lead! If you have any questions about your potential contribution and its place in the DataTables project structure, please ask ahead of time in the DataTables forums. Pull requests will only be accepted if you acknowledge that your contribution is offered under and will be made available under the project's existing license (MIT). If your initial pull request doesn't explicitly acknowledge this I'll ask before it is pulled in.
- Building DataTables › Extensions › OutputThe built extensions are placed into built/DataTables/extensions where the examples can immediately be run from a localhost.
- Server-side processing › Server-side › Implementation detailssearchBuilder.preDefined documentation for full details. The data structure documented
Examples
- DataTables › ISO8601 detectionDataTables supports ordering of ISO8601 date / time formats without any additional configuration. The Start date column in the example below shows this. Click on the column header to sort chronologically.
- DataTables › Default ordering (sorting)With DataTables you can alter the ordering characteristics of the table at initialisation time. Using the
order
initialisation parameter, you can set the table to display the data in exactly the order that you want. Theorder
parameter is an array of arrays where the first value of the inner array is the column to order on, and the second is'asc'
(ascending ordering) or'desc'
(descending ordering) as required.order
is a 2D array to allow multi-column ordering to be defined. The table below is ordered (descending) by the Age column. - DataTables › Nested object data (objects)DataTables has the ability to use data from almost any JSON data source through the use of the
columns.data
option. In its simplest case, it can be used to read arbitrary object properties, but can also be extended to n levels of nested objects / arrays through the use of standard Javascript dotted object notation. Each dot (.
) in thecolumns.data
option represents another object level. In this examplehr.position
refers to theposition
property of thehr
object in the row's data source object, whilecontact.0
refers to the first element of thecontact
array. Any number of dots can be used to obtain deeply nested data. The example below shows DataTables reading information for the columns from nested objects and arrays, where the structure of the row's data source in this example is: { "name": "Tiger Nixon", "hr": { "position": "System Architect", "salary": "$3,120", "start_date": "2011/04/25" }, "contact": [ "Edinburgh", "5421" ] }