2016-04-06 5 views
0

Ich versuche, einige fest codierte Daten in meinem Datatable anzuzeigen, aber aus irgendeinem Grund wird nichts angezeigt. Ich habe den folgenden Code:Anzeigen von Json-Daten in DataTables

js

financialTargetData = [ 
    {"FirstName": 'Dan', 
    "UserId": "1", 
    "Sex": 'Male'}, 
    {"FirstName": "Peter", 
    "UserId": "2", 
    "Sex": "Male"} 
]; 

attached() 
{ 
    var that = this; 
    $('#financialtargettable').DataTable({ 
     "data": that.financialTargetData, 
     "lengthMenu": [[12, 24, 36, -1], [12, 24, 36, "All"]], 
     "paging": true 
    }); 
} 

html-Datei

<template> 
<div class="container-fluid"> 
    <div class="row"> 

     <div class="col-sm-12"> 
      <h2>Financial Targets</h2> 

      <div class="box"> 
       <div class="box-header"> 
        <h3 class="box-title">Data Table With Full Features</h3> 
       </div><!-- /.box-header --> 
       <div class="box-body"> 
        <table id="financialtargettable" class="table table-bordered table-striped"> 
         <thead> 
          <tr> 
           <th>FirstName</th> 
           <th>UserId</th> 
           <th>Sex</th> 
           <!--<th>GrossWorkingDays</th>--> 
           <!--<th>NetWorkingDays</th>--> 
          </tr> 
         </thead> 
        </table> 
       </div><!-- /.box-body --> 
      </div><!-- /.box --> 

     </div> 

    </div> 
</div> 

Datei Ich Javascript ES6 bin mit der Aurelia Rahmen. Ich weiß nicht, was mehr Informationen zu geben, aber es gibt mir keine Fehler und ich weiß einfach nicht, was los ist ...

Jede Hilfe würde sehr geschätzt werden.

Dank

Antwort