Attribute Name Class

Class dsattr-<name> defines a JSON attribute (or property). To assign, say, a lastname attribute to a table cell that contains a person's last name, you will add HTML class dsattr-lastname to that cell.

For example:

<td class="dsattr-lastname">
Doe
</td>
...
<td class="dsattr-firstname">
John
</td>

The JSON object generated from this markup will contain lastname и firstname properties:

{
...
"lastname": "Doe",
"firstname": "John",
...
}

Take a look at an actual template:

images/wiki/download/attachments/44696033/Screenshot-78.png

The resulting JSON looks like this:

images/wiki/download/attachments/44696033/Screenshot-80.png

Attribute names should contain only alphanumeric characters and dashes. Here are some examples of valid attribute names:

  • lastname

  • lastName

  • last-name

It is strongly recommended to use one of the naming patterns above.