2016-12-16 21 views
0

jsonモデルバインディングでスマートテーブルを使用してSAPUI5アプリケーションを開発しようとしています。 While running this program I'm getting error I'm sharing that snapshot with you 私は自分のコードを共有しています、ビューではこのSmartTableとJSONModelバインディングを使用したアプリケーション

を達成するためにどのように私を提案してください:コントローラで

<smartTable:SmartTable 
     id="smartTable_ResponsiveTable" 
     smartFilterId="smartFilterBar" 
     tableType="ResponsiveTable" 
     editable="false" 
     entitySet="tableSet" 
     useVariantManagement="false" 
     useTablePersonalisation="false" 
     header="Products" 
     showRowCount="true" 
     useExportToExcel="false" 
     enableAutoBinding="true" 
     initiallyVisibleFields="name"> 
    </smartTable:SmartTable> 

を:

var array = [{ 
       "name" : "Dinesh", 
       "id" : "123" 
      }, 
      { 
       "name" : "Nikhil", 
       "id" : "456" 
      },{ 
       "name" : "Pulkit", 
       "id" : "789" 
      }]; 
      var model = new sap.ui.model.json.JSONModel(); 
      model.setData({ 
       tableSet: array 
      }); 
      this.getView().byId("smartTable_ResponsiveTable").setModel(model); 
      }); 

これを行う方法を私に勧めてください。

答えて

0

ビューで列を定義しようとするとどうなりますか?

<smartTable:columns>       
(your columns)     
</smartTable:columns> 

よろしく、 ガブリエル

+0

こんにちはガブリエルは、回答を与えていただきありがとうございます。私は以下のように私のコードに列タグを追加 \t \t \t \t \tこれを追加した後、私は次のエラーを取得していますが「SAP/UI /コンプ/ smarttable /列のロードに失敗しました。 js 'https://sapui5.netweaver.ondemand.com/resources/sap/ui/comp/smarttable/columns.js:404 - エラー。何が問題なのか、その中に列を追加する方法を述べてください(サンプルコードを提供してください)よろしく、Dinesh – Dinesh

+0

exploredの例ではxmlビューの列が定義されていないので、 。唯一のアドバイスは、調査の例に従うことです: –

+0

https://sapui5.netweaver.ondemand.com/explored.html#/entity/sap.ui.comp.smarttable.SmartTable/samples –

関連する問題