2012-01-04 9 views
1

私はテーブルの行タグに入れるデータ属性をいくつか持っています。 テーブルをwijgridに設定すると、データ属性が破棄されます。Wijgridがデータ属性を破棄する

wijmoはこれらの属性を破壊しないようにするにはどうすればよいですか?

答えて

1

行に属性を適用する場合(tr)、それらは(経験したように)プラグインによって単純に無視されます(スタイル、クラス、データなど)。

通常、行の属性を抽出するコードは、プラグインソースにコメントされています。方法readTableSection

、我々は(私はここでのコードの関係のない行を削除)持っている:私は、「データ - 」でテストを行っている

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; 
} 

td要素の属性とそれらが破壊されません。

注:オプションreadAttributesFromDataを使用する必要があります。

このプラグインを開発した会社に連絡して、この行をコメントアウトした理由を尋ねることができます。

+0

これはまったく予期しないことです。私は彼らがwijmo-fiedグリッドを作ったとき属性を削除したことを知っていました。しかし、それを防ぐための選択肢があることを期待していた。私はバグやデッドコードが原因であるとは思わなかった。 –

関連する問題