* Add attributes to a row based on the special `DT_*` parameters in a data * source object. * @param {object} settings DataTables settings object * @param {object} DataTables row object for the row to be modified * @memberof DataTable#oApi
(settings, row)
| 2931 | * @memberof DataTable#oApi |
| 2932 | */ |
| 2933 | function _fnRowAttributes(settings, row) { |
| 2934 | var tr = row.nTr |
| 2935 | var data = row._aData |
| 2936 | |
| 2937 | if (tr) { |
| 2938 | var id = settings.rowIdFn(data) |
| 2939 | |
| 2940 | if (id) { |
| 2941 | tr.id = id |
| 2942 | } |
| 2943 | |
| 2944 | if (data.DT_RowClass) { |
| 2945 | // Remove any classes added by DT_RowClass before |
| 2946 | var a = data.DT_RowClass.split(" ") |
| 2947 | row.__rowc = row.__rowc ? _unique(row.__rowc.concat(a)) : a |
| 2948 | |
| 2949 | $(tr).removeClass(row.__rowc.join(" ")).addClass(data.DT_RowClass) |
| 2950 | } |
| 2951 | |
| 2952 | if (data.DT_RowAttr) { |
| 2953 | $(tr).attr(data.DT_RowAttr) |
| 2954 | } |
| 2955 | |
| 2956 | if (data.DT_RowData) { |
| 2957 | $(tr).data(data.DT_RowData) |
| 2958 | } |
| 2959 | } |
| 2960 | } |
| 2961 | |
| 2962 | /** |
| 2963 | * Create the HTML header for the table |
no test coverage detected