我从服务器获取 json 格式的数据,我使用下面的代码在页面上呈现它。但无法在列(即单元格)上设置属性“名称”。sName 是我应该用来为每个单元格设置“名称”属性的正确属性吗?
这是我的数据表代码。
$('#' + self.dom.tableID).dataTable({
"asStripeClasses": [self.ui.rowClass],
"bPaginate": true,
"bLengthChange": false,
"bFilter": true,
"iDisplayLength": 15,
"bSort": true,
"bInfo": false,
"bAutoWidth": true,
"sDom": "tip",
"aoColumns": [
{ "mDataProp": "name", "sClass": self.ui.nameCellClass, "sWidth": "35%", "sTitle": "Name" },
{ "mDataProp": "email", "sTitle": "Email"},
{ "mDataProp": "phone", "sTitle": "Phone"},
{ "mDataProp": "organizationName", "sTitle": "Organization"},
{ "mDataProp": "organizationRenewDate", "sTitle": "Expires on", "sWidth": "100px", "sType": "date"}
],
"oLanguage": {
"sZeroRecords": "No matching members found."
}
});
顺便说一句,我需要每个单元格上的“名称”属性将数据发送回服务器端代码。