Table design #
Table creation #
Create a new table design #
There are two ways to create a new table design:
- Click on Design new table at the top of the Data Explorer main page to create a new table design.
- Navigate to the Data Designer menu and click on Design new table at the top of the Data Designer page to create a new table design.
Create a table design from an existing database table #
Call the Data Designer directly from the Data Explorer to alter specific tables. Find your table, click the Manage link and click ALTER on the Actions tab.
Local and remote databases #
The Data Designer can be used for local as well as remote databases, presuming you have the necessary privileges.
Local and remote databases #
The Data Designer can be used for local as well as remote databases, presuming you have the necessary privileges.
Modes #
Advanced – Use this option to create tables if you have some basic understanding of database tables.
Developer – If you are an experienced developer, you can execute your own scripts from the Data Explorer or use the Query Builder.
Reverse engineering #
Use reverse engineering to create a table design from an existing table. Indexes are reverse engineered as well. The Data Designer allows you to make modifications to your table design and then either alter your existing table or create a new one.
Reconcile #
The reconcile feature performs a reverse engineering action on the selected table. The actual table design will be overwritten with the reverse engineered version. After a reconcile action, the table design matches the structure of the physical table.
Hi Peter,
Is there a way to display only part of the field that is retrieved from the remote database, I have a date field that also has a default time 00:00 at the end, I only want to display the date part (10 length yyyy-mm-dd), I tried to set the filed lenght and type in the Designer (please see screenshot: https://gyazo.com/5a8234bedb6c450e0c0a2827bf816dcb), but it has no effect on the search results page: https://www.rutherfordglobal.com/pars-search-results/?wpda_search_column_ccn=014-57776806&wpda_search_column_po= (screenshot here: https://gyazo.com/a9f0ce536e91b4d498196291cec877f4)
Thanks,
Joseph
Hi Joseph,
Data Tables does not use the WordPress date format as it uses jQuery DataTables. So you have to do this manually (at least for now). There are two ways to do this:
(1) Use a view and format your data column in your view definition (SQL)
(2) Add a renderer (JavaScript)
There is tutorial how to add a renderer here:
https://wpdataaccess.com/docs/data-tables-advanced-features/advanced-settings/
Please search for: fnRowCallback
But…I think it should be possible to use the WordPress date format. So I added this issue to my to do list. Not sure if I manage to add it to the next release, but I’ll do my best. Hope you don’t mind to wait a little… 🙂
Thanks,
Peter
Hi Peter,
Appreciate your quick response time and solution provided, I’ll try each of the suggestions and see how it goes and of course I’ll be glad to wait for a final WordPress solution 🙂
Meantime wishing you and your team A Very Happy New Year
Thanks,
Joseph
Hi Peter
Tried to look up all the documentation for dom on https://datatables.net/reference/option/dom, but not able to find anything related to how would I display only first 10 characters of the date value retrieved from the Production remote table or hide anything after 10 characters
This is what I had in my original php page before moving to WordPress:
$itemDate = $row['rdate'];
echo substr($itemDate, 0, 10);
Any suggestion how I convert this to add it in Data Tables Table options (advanced)
Thanks,
Joseph
Hi Joseph,
Below you’ll find the solution. I hope! 🙂 I cannot test it for you…
Please paste this JSON code into the table options advanced column of your publication:
{ "columns":
[ null, null, null,
{ "data": "3", "render": "function ( data, type, row, meta ) { return data.substr(0,10); }" },
null, null, null, null ]
}
The third column, which is your date column, is rerendered. If you change your publication, you might need to change your JSON code as well. Make sure the position of your date column matches the position in the columns array:
"data": "3"
(start counting from 0).Wishing you a very happy new year! 🙂
Best regards,
Peter
Hi Peter,
Thank you very much, appreciate your help, I added the code and noticed that now the Date is being rendered as full month dd, yyyy so i adjusted the length of the substr to 18, looks fenomenal, even better than before, much appreciated.
Happy New Year 🙂
Thanks,
Joseph
Is there any way to widen columns from the default width to accommodate longer data strings?
Hi Wayne,
Is this for your data table or data form? For data tables, it’s possible to set custom widths on each column. The width will also depend on your overall table width, which in turn is constricted within your page’s specified width. Feel free to message us here if you need more help!