2017-02-01 1 views
0

나는 문제가있어 도움을 얻을 수 있기를 바랍니다. sap.m.page에 나는 항목의 경우 목록 (sap.m.list)sap.m.list - 행 숨기기

new sap.m.Page(
      "mainPage", { 
       title : "", 
       enableScrolling : true, 
       content : [ 
        oList = new sap.m.List("items", { 
         threshold : 2, 
         inset : false, 
         headerText : "Aufträge", 
         //filters : filters, 
         columns : [ 
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '45px', 
           //styleClass : "qty", 
           header : new sap.m.Label({ 
            text : "Station" 
           }) 
          }), 
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '40px', 
           header : new sap.m.Label({ 
            text : "Zeit" 
           }) 
          }), 
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '20px', 
           header : new sap.m.Label({ 
            text : "" 
           }) 
          }),  
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '20px', 
           header : new sap.m.Label({ 
            text : "" 
           }) 
          }),         
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '50px', 
           header : new sap.m.Label({ 
            text : "Raum" 
           }), 
           minScreenWidth : "Phone"//XXSmall" 
           //demandPopin : true 
          }), 
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '40px', 
           header : new sap.m.Label({ 
            text : "Bett" 
           }), 
          }), 
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '20px', 
           //styleClass : "qty", 
           header : new sap.m.Label({ 
            text : "St." 
           }) 
          }), 
          new sap.m.Column({ 
           hAlign : "Left", 
           width : '20px', 
           //styleClass : "qty", 
           header : new sap.m.Label({ 
            text : "Typ" 
           }) 
           (...) 

에 놓여있다 난 템플릿은

//Template für die Listzeilen 
      var template = new sap.m.ColumnListItem({ 
       type : "Navigation", 
       cells : [ 
        new sap.m.Label({ 
         text: "{Orgpf}" 
        }), 
        new sap.m.Label({ 
         text : "{Uhrzeit}" 
        }), 
        new sap.ui.core.Icon({ 
         src: "{IconTermin}" 
        }), 
        new sap.ui.core.Icon({ 
         src: "{IconAufbereitung}" 
        }),         
        new sap.m.Label({ 
         text: "{Bett}" 
        }), 
        new sap.m.Label({ 
         text: "{Bettnr}" 
        }), 
        new sap.m.Label({ 
         text : "{Status02}" 
        }), 
        new sap.m.Label({ 
         text: "{Betttyp}" 
        }) 

(...)

을 definded 한 목록의 데이터는 수액 게이트웨이의 odata-service에서 가져옵니다. 나는 평범한 테이블을 채우고있다.

var filter = new sap.ui.model.Filter("Team", sap.ui.model.FilterOperator.EQ, localStorage.getItem("Team"));  
      oList.bindAggregation("items", { path: "/AuftragSet", filters: filter, template}); 

이것은 잘 작동한다.

문제점 : 항목을로드 한 후에 모든 항목이 표시되지는 않습니다. 특별한 타입의 visibile 엔트리를 처리 한 후에는 해당 엔트리를 볼 수 있어야합니다. 나는 모든 장소에서 인터넷 접속이 없기 때문에 서비스로 데이터를 다시 읽고 싶지 않다. 따라서 더 많은 항목을 선택하고 일부 항목을 숨길 필요가 있습니다. 어떻게 해결할 수 있을까요? 필터는 어디에서 설정할 수 있습니까?

THX 귀하의 답변입니다. 모든 데이터를 다운로드하고 싶은 몇 가지 선택을 표시하기 때문에

종류와 관련,

스벤 귀하의 경우에는

+0

어떤 기준으로 행을 숨기시겠습니까? OData 응답의 필드 또는 플래그입니까? –

+0

sap.ui.model.Filter (Google에서 설명서를 찾을 수 있음)를 설정하거나 열 목록 항목의 'visible'속성을 사용하여 재생할 수 있습니다. –

+0

oData 응답에 플래그가 있습니다. 필터가 작동하지 않습니다. –

답변

0

는, 필터는 좋은 옵션이 아닙니다. 반면에 Filter를 사용하면 서버가 몇 가지 행을 반환하여 목적을 달성 할 수 있습니다.

상속 된 visible 속성은 sap.m.ColumnListItem입니다. 템플릿을 정의 할 때 visible 속성을 추가하고 OData 속성에 바인딩합니다. 열 sap.m.List이되지 않습니다으로

var template = new sap.m.ColumnListItem({ 
type: "Navigation", 
visible: "{put you OData determining property here}", 
cells: [...] 
}); 

또한, sap.m.Table 또는 그 서브 클래스 중 하나를 사용하는 것이 좋습니다. https://sapui5.hana.ondemand.com/docs/api/symbols/sap.m.List.html#addColumn. 이 도움이 https://sapui5.hana.ondemand.com/#docs/guide/148892ff9aea4a18b912829791e38f3e.html

희망 :

사용이 링크는 사용할 테이블을 결정합니다.

+0

THX. 잘 작동합니다. 다음 버전에서는 sap.m.Table을 사용해 봅니다. –