1

dyntable を使用して html テーブルにデータを書き込もうとしています。ヘッダーの 1 つは と呼ばれWeek of yearます。JSON ファイルでは、名前もWeek of year(スペース付き) です。json を dynatable に渡す場合:

$('#week_table').dynatable({
    dataset: {
        records: [{"Week of year":"June 9, 2014 to June 15, 2014","a":0.0,"b":0.0,"c":0.0,"d":0.0,"e":1.0,"f":0.0},{"Week of year":"June 16, 2014 to June 22, 2014","a":0.0,"b":0.0,"c":5.0,"d":0.0,"e":16.0,"f":0.0}]
}});

そしてhtmlテーブルへの描画:

  <table id="week_table">
    <thead>
      <th>weekOfYear</th>
      <th>Week of year</th>
      <th>a</th>
      <th>b</th>
      <th>c</th>
      <th>d</th>
      <th>e</th>
      <th>f</th>
    </thead>
    <tbody>
    </tbody>
  </table>

aテーブルはto に対しては適切に描画されますが、とfの両方について未定義として表示されます。スペースを含むdynatableにjsonを渡すにはどうすればよいですか?weekOfYearWeek of year

4

1 に答える 1