テーブル行タグに入れたいくつかの data- 属性があります。テーブルを wijgrid に設定すると、data- 属性が破棄されます。
wijmo がこれらの属性を破壊しないようにするにはどうすればよいですか?
行 ( ) に属性を適用するとtr
、(経験したように) プラグインによって単純に無視されます (スタイル、クラス、データなど)。
行の属性を通常抽出するコード部分がプラグイン ソースでコメント化されているため、これは任意のようです。
methodreadTableSection
には、次のものがあります (ここでは関係のないコード行を削除しました):
readTableSection: function(table, section, readAttributes) {
...
if (table && (section = this.getTableSection(table, section))) {
for (ri = 0, rowLen = section.rows.length; ri < rowLen; ri++) {
row = section.rows[ri];
tmp = [];
if (readAttributes) {
// here normally the html attributes of the rows (<tr>) should be extracted
// but the code is commented !
tmp.rowAttributes = null; // $.wijmo.wijgrid.getAttributes(row);
tmp.cellsAttributes = [];
}
// here is extracted the html attributes for the cells (<td>)
for (ci = 0, celLen = row.cells.length; ci < celLen; ci++) {
tmp[ci] = row.cells[ci].innerHTML;
if (readAttributes) {
tmp.cellsAttributes[ci] = $.wijmo.wijgrid.getAttributes(row.cells[ci], prevent);
}
}
result[ri] = tmp;
}
}
return result;
}
要素の「data-」属性を使用してテストを行いましたがtd
、それらは破棄されません。
注: オプションを使用する必要がありますreadAttributesFromData
。
このプラグインを開発している会社に連絡して、この行をコメントアウトした理由を尋ねてください。