Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在SAPUI5中使用数据表中的列内容时将列可见性设置为false_Javascript_Jquery_Datatables_Sapui5 - Fatal编程技术网

Javascript 如何在SAPUI5中使用数据表中的列内容时将列可见性设置为false

Javascript 如何在SAPUI5中使用数据表中的列内容时将列可见性设置为false,javascript,jquery,datatables,sapui5,Javascript,Jquery,Datatables,Sapui5,当我在datatable上使用setVisible(false)将列可见性设置为false时,我使用该特定列内容为行着色的逻辑不起作用。当我将列可见性移除为false时,它会正确地为行着色。如您所见,我使用最近的(“tr”)来获取最近的行,并根据列单元格值对其进行着色,但我不希望该列显示在表中 oTable.addColumn(new sap.ui.table.Column({ label : new sap.ui.commons.Label({

当我在datatable上使用setVisible(false)将列可见性设置为false时,我使用该特定列内容为行着色的逻辑不起作用。当我将列可见性移除为false时,它会正确地为行着色。如您所见,我使用最近的(“tr”)来获取最近的行,并根据列单元格值对其进行着色,但我不希望该列显示在表中

            oTable.addColumn(new sap.ui.table.Column({
            label : new sap.ui.commons.Label({
                text : "Totaltype"
            }),
            template : new sap.ui.commons.TextField().bindProperty("value",
            "Totaltype", function(cellValue){ 
                //var backgroundColorChanged = false;
                switch(cellValue){  
                case 'S':  
                          backgroundColor = 'yellow';
                          backgroundColorChanged = true;
                          break;
                case 'T':  
                    backgroundColor = 'red';
                    backgroundColorChanged = true;
                    break;                              
                default:  
                          backgroundColor = 'white'; 
                }
                //if (backgroundColorChanged == true){
//                  backgroundColorChanged = false;
                cellId = this.getId(); 
                //$("#"+cellId).parent().parent().css("background-color",backgroundColor); 
                //}
                $("#"+cellId).closest("tr").css("background-color",backgroundColor);
                  return cellValue; 
            }),
            sortProperty : "Totaltype"
        }).setVisible(false));