2014-09-11 1 views
-1

버튼 클릭으로 표 열을 숨기거나 표시하려면 어떻게합니까?SAP UI 5 표 열

Check Here

외부 버튼을 클릭하면 가격 열을 숨기거나 표시해야합니다.

+1

버튼을 클릭하면 열의 가시성이 false로 설정됩니다. – Saddamhussain

+0

이미 시도한 코드를 보여주십시오. – qmacro

답변

0

가 그래 우리는 테이블 열 설정 한 다음 속성에 액세스 할 수 있습니다 도움이 될 것입니다.

var tab= this.getView().byId("idProductsTable"); 
col=tab.getColumns()[5]; 
tab.getColumns()[5].setProperty("visible",false); 
0
var oTable = new sap.ui.table.Table(); 

     var oProduct=new sap.ui.table.Column({ 
      label: new sap.ui.commons.Label({text: "Product"}), 
      template: new sap.ui.commons.TextView({ 
       text:"TExt" 
      }) 
     }); 

     var oPrice=new sap.ui.table.Column({ 
      label: new sap.ui.commons.Label({text: "Price"}), 
      template: new sap.ui.commons.TextView({ 
       text:"price" 
      }) 
     }); 
     oTable.addColumn(oProduct); 
     oTable.addColumn(oPrice); 

     //Button 

     var oButton = new sap.ui.commons.Button({text:"Button", 
      press:function(){ 
       oPrice.setVisible(false); 
      } 
     }); 

이 반드시 다음과 같이