Spry

Set custom column names

Commonly, the first row of an HTML table is a header row that names the columns beneath it. By default, Spry uses the first row to set column names in the data set, and from these you can derive the data reference names that you use in the pages that display your data ({email}, {firstname}, and so on). In generic HTML structures, however, the first repeating element in the structure may or may not be an actual table column name, so you can set custom column names if you need to.

 To set custom column names, set the columnNames option in the constructor, as follows:
var ds1 = new Spry.Data.HTMLDataSet(null, "myContainer", {columnNames:['firstcolumnname','secondcolumnname']});

When you use the columnNames option, the number of custom column names in the array must equal the number of columns in the data set. After you’ve set custom column names, you can use them in Spry regions as your data references.

Note: When you use custom column names in an HTML table, and firstRowAsHeader is true (the default), Spry does not use the first row’s (the header row’s) column names in the data set. When you set custom column names, Spry always uses them in the data set instead.