Jquery データテーブルは jsonarray の値を解釈しません。テーブルに 1 文字しか表示されません。
<table border="1" cellspacing="0" cellpadding="0" id="products" style="clear:both;">
<thead>
<tr>
<th>Product</th>
<th>Description</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
サーバーからの実際のデータ形式:
["Element software","Software dist","Global envir","Software","Software list"]
jqueryデータテーブルコード:
var oTable = $("#products").dataTable({
"aaData" : data,
"bProcessing" : true,
"sPaginationType" : "full_numbers",
"bJQueryUI" : true,
"bRetrieve" : true,
"bPaginate" : true,
"bStateSave" : true,
"bSort" : true,
"aaSorting" : [[ 4, "desc" ]],
"iDisplayLength" : 25,
"oLanguage": {
"sProcessing": "processing",
"sEmptyTable": "No records found."
}
});
アクション クラス:
JSONArray ja = new JSONArray();
try {
Iterator it = List.iterator();
while(it.hasNext()){
SearchResult part = (SearchResult) it.next();
ja.add(part.getlist1());
ja.add(part.getlist2());
findList.addAll(ja);
}
配列リストであるfindListを返します。
データを datatable に解釈する方法は?