How to externalize web page elements to make it configurable?
I am looking for some design patterns or best practices for configuring web page fields.
My web page has a table, whic开发者_JS百科h is dynamically created by my API (Wicket).
Currently all the column names are hard coded in the java but I want to make it externalizable that way I can add/remove/modify fields without modifying java code.
Also I want to define each field type, valid value ranges etc.. in this external file.
Are there any recommended approaches for this requirement?
I've switched all my tables over to JQuery-rendered Datatables I output either HTML tables or (better) JSON data and then let the script build the table. I have full control over columns, sorting, filtering, style, etc via the jQuery configuration script which is rather straightforward. I can even programmatically update via javascript calling JSON over AJAX, so the table can dynamically refresh via just about any means imaginable. From a UI standpoint the results look great and are quickly styled via Themeroller with a few clicks. You really can't go wrong.
精彩评论