"iScrollLoadGap":2,
"bAutoWidth":true,
"bDeferRender":false,
//"aoColumnDefs":,
//"sScrollY":"100%",
//延遲加載
//"iDeferLoading":5,
"sZeroRecords": "沒有檢索到數據",
"aoColumns": [
{ 'mDataProp':'productCode',"bSortable": false,"sTitle":"商品編碼"},
{ 'mDataProp':'coverSmallImage',"bSortable": false,
"mRender": function ( data, type, row ) {
return '<div style="text-align:right;"><input class="checkbox1" type="checkbox" style=" float:left; margin-top:18%;height:20px;width:20px;"><img style="height:80px; width="90px;" src="http://125.oss-cn-beijing.aliyuncs.com/'+data+'"></div>';
}
},
{ 'mDataProp':'productName',"bSortable": false,"sTitle":"商品名稱"},
{ 'mDataProp':'productPrice',"bSortable": false,"sTitle":"價格"},
{ 'mDataProp':'salePrice',"bSortable": false,"sTitle":"促銷價格"}
],
"aLengthMenu": [
[5, 10, 15, 20,50,100, -1],
[5, 10, 15, 20,50,100, "全部"] // change per page values here
],
我想要商品編碼列隱藏該怎麼做
隱藏單是要能取值
aoColumnDefs 屬性嗎
{ 'mDataProp':'productCode',"bSortable": false,"sTitle":"商品編碼","sClass":"hiddenCol"}
這就對Column 加入了一個css Class 了,然後就通過設置樣式來控制咯。。。
後面這些沒測試過,大致思路是這樣的
在CSS加入
.hiddenCol
{
display:none;
}
或者
.hiddenCol
{
visible:false;
}