Two weeks ago we updated dhtmlxSuite to the version 4.1. This update introduced a new interesting function – dhtmlxTemplate. We decided to tell more about it in case if some of you haven’t tried to use it yet.
What is DHTMLX Template?
It is a function that allows using templates instead of fixed values. This means that you can have one and the same text which will have different dynamic parts (templates). You may use string, date or number templates or create your own one.
Where to use Template?
You can use templates in any texts that are identical in their structure and meaning, but should be different in some parts like names of the people to whom you address in the newsletter, tables with variety of data (date, telephone number, etc.), different views of one and the same object that can be switched on-the-fly (e.g., the grid of goods in online stores), and so on.
How to use Template?
Fistly, you should know a template format. The dynamic parts that are changed should be inframed by “#”, inside we have the name of a key from json object with additional params. These params are the names of the additional functions for formatting and their arguments.Read more »