【发布时间】:2015-02-13 16:18:33
【问题描述】:
我在我的项目中使用 jQuery DataTables。
我正在使用 ajax 以 JSON 格式获取数据并使用它初始化数据表,但如果数据列包含 ABC XYZ 的值(注意 ABC 和 XYZ 之间有 2 个空格),渲染输出中不会保留多个空格。
JSP 代码
<table id="marketViewStatusDT" class="display" style="cellspacing:0;width:100%;background-color: #ffffff;" >
<thead>
<tr>
<th style="width:12%;height:30px;" class="aleft">UTI</th>
<th style="width:5%;height:30px;" class="aleft">Source </th>
</tr>
</thead>
</table>
JS 代码
marketViewStatusDT = $("#marketViewStatusDT").DataTable( {
"sDom": '<"H"l<"toolbar">p>t<"F"ip>',
"bDestroy":true,
"bProcessing" : true,
"bServerSide" : true,
"bLenthChange" : false,
"bJQueryUI" : false,
"lengthMenu": [[20, 50, 100], [20, 50, 100]],
"bSort" : true,
"bFilter": false,
"bPaginate": true,
"bSearchable": true,
"pagingType": "full",
"scrollY": calcDataTableHeight(),
"scrollX": true,
"sAjaxSource" : "fetchData.html",
"aoColumns": [
{ "mData": "uti",},
{ "mData": "source",}
],
});
【问题讨论】:
标签: jquery datatables