DataTables Blog http://www.datatables.net/blog en-us Tutorials and news about DataTables Cascading lists in Editor Working with categories and sub-categories is a very common action in data intensive applications. It can be useful both for the programmer (i.e. you!) in terms of data manipulation and for the end user's conceptual model of the data. Categories are easy with Editor's select option - simply populate it with data and the end user can select from it. Sub-categories require a little more interaction since the options available depend on the value the user has selected for the main category. Having said that it is still quite straight forward in Editor!

In this post I'll demonstrate how to create the following table, where the country can be narrowed down by continent:

Sales team
Name Location
Contient Country

Continue reading...

]]>
Fri, 01 Sep 2017 14:46:00 GMT http://www.datatables.net/blog/2017-09-01 http://www.datatables.net/blog/2017-09-01
Editor and NPM npm has become the de facto package manager for Javascript libraries, owing in part to how easy it makes it to install software and dependencies, but also due to the huge amount of software that is available through the npm directory. DataTables and its extensions are available on npm making installation and integration of DataTables very easy with any given tool chain / build process (and there are plenty of them in the Javascript world!).

npm is ideally suited for distribution of open source software such as DataTables, but it doesn't work so well for commercial software such as Editor. The full Editor package is only available to license holders, a license which npm knows nothing about. The source for Editor could be placed on npm for distribution but there would be no way to enforce the license - and the license fees from Editor is what makes continued development and support of DataTables and its other extensions possible!

This post describes the new datatables.net-editor package which can be used in combination with the Editor download package to be able to use Editor in an npm tool chain, just as you would with any other library.

Continue reading...

]]>
Thu, 31 Aug 2017 17:35:00 GMT http://www.datatables.net/blog/2017-08-31 http://www.datatables.net/blog/2017-08-31
Deep linking into DataTables A question that comes up relatively frequently in the forums is "how do I deep link into a DataTable?" This is usually asked in the context of SEO where you want to ensure that all of the data in the table is indexable, but it can also be appropriate in applications where you want to show a table with a specific search term pre-set.

Typically the answer to such a question is to use the initialisation parameters to set whatever option is required from the search string, but it is such a common thing to want to do, it is sensible that we generalise it. To that end, here I present a short script that can be used to extract parameters from a search string and use them to populate a DataTable.

Let's see it in action first - follow the links below to observe the behaviour on the demonstration table:

{example-table}

Continue reading...

]]>
Mon, 24 Jul 2017 15:55:00 GMT http://www.datatables.net/blog/2017-07-24 http://www.datatables.net/blog/2017-07-24
Always visible editing panel When you are working with a software library, you want it to fit into your site and design - not have it force you to its way of thinking. This philosophy is deeply engrained into both DataTables and Editor, as shown by their ability to be styled by various popular CSS frameworks. Editor in particular is designed from the ground up to be flexible and fit into your applications.

The default mode of editing a form in Editor is with a modal window (also sometime referred to as a lightbox). This can be a useful interface paradigm for the end user as it provides separation between the data access and data writing - it quite literally looks like different layers. The downside is that because the form overlays the rest of the page you can loose the context of the data you are editing. This isn't always an issue, but in complex applications it can be useful for the user to refer to other data points when editing a row.

To that end, one common question for Editor is, if it has the ability to show its form in a dedicated area on the page, not in a modal, but rather alongside other content. Absolutely, this is possible! An example is shown below. In this post I'll describe how this example was put together.

Example

Name Salary
Name Salary

Select a row
to edit or delete

Or add a new row

Continue reading...

]]>
Fri, 30 Jun 2017 22:43:00 GMT http://www.datatables.net/blog/2017-06-30 http://www.datatables.net/blog/2017-06-30