On the DataTables blog you will find news, announcements and tutorials about DataTables and its suite of extensions. New posts are published (usually!) monthly, with additional news items in between.
A web-based CRUD system such as Editor is by its very nature concurrent - i.e. multiple users could be updating data at the same time. Those users might be in the same office, or they might be on opposite sides of the world, but one thing you don't want to happen is for one user to make updates to a row, then have another user undo those changes by submitting information without realising it has changed already.
Ultimately the best solution for this is to update the data in the table in real-time - that is a complex topic and something we will be exploring in future (stay tuned!), but in this post I would like to introduce a mechanism that can be used with minimal code effort and no disruption in an existing code base: refreshing the data for the row(s) to be edited when the user triggers editing on a row.
To do this, we'll develop a new Button that can perform this action before triggering editing, in a reusable component. The result is shown below (note that this looks very similar to standard editing in Editor, but an Ajax request is used to refresh the data when clicking Edit. A second browser window showing this page can be used to create your own form of concurrency, updating the data from one in the other:
There's been several forum questions recently asking how to configure DataTables or Editor within a WordPress website. This blog post provides a simple demonstration to quickly get DataTables and Editor working on your page. In this demonstration we show how to install DataTables in WordPress using two different methods:
- Direct script inclusion for fine grained control
- TablePress - a WordPress plug-in by Tobias Bäthge for a fully integrated DataTables / WordPress editing environment.
We also discuss how to install and configure Editor using direct inclusion.
Happy New Year everyone. Last year we took a bit of a step back from the blog while focusing on other aspects of DataTables, the extensions and support, but in 2019 we will be more regular with blog posts. To get us started we are going to revisit the Editor parent / child post. Parent / child editing is quite a popular topic for when you have one-to-many database structures, letting end users edit data from both tables on a single page.
The most frequent question about the previous post is "how do we do this with child rows, rather than having a child table always shown?" So that's what we are going to explore in here. As a quick start, here is the result we are aiming for: