每当我设置任何列属性visible:false
时。所有列标题都消失了。
下面是我的代码。在其中,我将“创建于”列标记为visible:false
。
var tbl;
$(document).ready(function() {
tbl = new Tabulator("#scheme-table", {
ajaxURL: restEndPoint.url+"/scheme/list",
ajaxConfig:"POST",
ajaxContentType:{
headers:{
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0',
"Content-type": 'application/json; charset=utf-8' //set specific content type
},
body:function(url, config, params){
var schemeFilter ={};
return JSON.stringify(schemeFilter);
}
},
height : '100%',
layout : "fitColumns",
tooltips:true,
tooltipsHeader: true,
addRowPos:"top",
pagination : "local",
index:"id",
paginationSize : 10,
columns : [ {
title : "Actions",
field : "id",
width : 100,
frozen : true,
headerSort : false,
formatter : actionRowIcon,
download :false,
cellClick : function(e, cell) {
}
}, {
title : "Scheme ID",
field : "id",
formatter:"link",
formatterParams:{
labelField:"id",
url:setUrl
},
width : 120,
align : "left",
headerSort : false,
cellEdited:function(cell){
}
}, {
title : "Scheme Name",
field : "name",
width : 566,
align : "left",
headerSort : false,
}, {
title : "Status",
field : "active",
width : 170,
align : "left",
headerSort : false,
cellClick : function(e, cell) {
},
}, {
title : "Created by",
field : "createdBy",
width : 170,
align : "left",
headerSort : false
}, {
title : "Created On",
field : "createdOn",
width : 170,
align : "left",
headerSort : false,
visible:false
}],
ajaxResponse:function(url, params, response){
var formattedData=[];
$.each(response, function( i, obj ) {
/var items={};
items["id"]=obj.id;
items["name"]=obj.name;
if(obj.active){
items["active"]='Active';
} else{
items["active"]='Inactive';
}
formattedData.push(items);
});
return formattedData;
},
renderStarted:function(){
$('#loading').show();
},renderComplete:function(){
$('#loading').hide();
}
});
}); //End of document ready
以下是屏幕截图:
我在引导选项卡(nav)的旁边创建表。在标签上,点击我正在致电tbl.redraw(true);
出乎意料的是,当我两次敲打标签时,牧民来了。
下面是标签屏幕截图