2017-12-14 11 views
1

jQuery datatablemvcで処理しています。あらかじめ定義された構文としてdatatableにバインドしてデータを取得します。 ajax呼び出し応答のjsonオブジェクトには、図に示すようにネストされたデータが含まれています。データオブジェクトのjsonオブジェクトからネストされたデータを取得する方法

enter image description here

私は正常にルートデータをフェッチしなかったが、私は、ネストされたデータは、そのデータを表示するために失敗を取得しようとします。

oTable =$(".dataTables-example").DataTable({ 
    stateSave: true, 
    "pagingType": "full_numbers", 
    "ajax": { 
     "url": "my_action_method_url", 
     "type": "POST", 
     "datatype": "json" 
    }, 
    pageLength: 10, 
    responsive: true, 
    "columns": [ 
     { 
      "mData": null, 
      mRender: function (data) { 
       return data['instituteName']; // working fine. 
      } 
     }, 
     { 
      "mData": null, 
      mRender: function (data) { 
       return data['personalInfo.title']; // not working. 
      } 
     } 
    ], 
    "serverSide": "true", 
    "order": [0, "asc"], 
    "processing": "true", 
    "language": { 
     "processing": "Loading data..." 
    } 
}); 

答えて

0

私はjQueryのデータテーブルを知らないが、通常のオブジェクトにあなたがdata.instituteNamedata.personalInfo.title

にアクセスすることができます
関連する問題