sap - how to read data from table (sapui5)? -


i have table i'm populating using json model. once data in try grab data table. problem can't grab rows. when returns null reason. i'm able columns not rows, odd.

here code.

  <t:table         id="searchresultstable"         visible="true"         selectionmode="multitoggle"         rows="{path: 'products>/productcollection'               }"         shownodata="true"         arialabelledby="title">         <t:columns>             <t:column                 id="awddatecolumn"                 sortproperty="awddate"                 width="11%"                 resizable="false">                 <label text="awd date">                 </label>                 <t:template>                     <text text="{path: 'products>awddate',                                 type: 'sap.ui.model.type.date',                                 formatoptions: {source: {pattern: 'dd/mm/yyyy'}, style: 'long'}}"/>                 </t:template>             </t:column>             <t:column                 id="ppicostcolumn"                 sortproperty="ppicost"                 width="7%"                 resizable="false">                 <label text="ppi cost">                 </label>                 <t:template>                     <text text="{products>ppicost}"/>                 </t:template>             </t:column>             <t:column                 id="histcostcolumn"                 sortproperty="histcost"                 width="7%"                 resizable="false">                 <label text="hist cost">                 </label>                 <t:template>                     <text text="{products>histcost}"/>                 </t:template>             </t:column>             <t:column                 id="piincolumn"                 sortproperty="piin"                 width="10%"                 resizable="false">                 <label text="piin">                 </label>                 <t:template>                     <link                         text="{products>piin}"                         press="handlelinkpress" app:mydata="{products>histppi},{products>qty},{products>awddate},{products>transactionnumber}" />                 </t:template>             </t:column>             <t:column                 id="histppicolumn"                 sortproperty="histppi"                 width="7%"                 resizable="false">                 <label text="hist ppi">                 </label>                 <t:template>                     <text text="{products>histppi}"/>                 </t:template>             </t:column>             <t:column                 id="currentppicolumn"                 sortproperty="currentppi"                 width="7%"                 resizable="false">                 <label text="curr ppi">                 </label>                 <t:template>                     <text text="{products>currentppi}"/>                 </t:template>             </t:column>             <t:column                 id="ppifactorcolumn"                 sortproperty="ppiconversionfactor"                 width="7%"                 resizable="false">                 <label text="ppi factor">                 </label>                 <t:template>                     <text text="{products>ppiconversionfactor}"/>                 </t:template>             </t:column>             <t:column                 id="transactionnumbercolumn"                 width="10%"                 visible="false"                 resizable="false">                 <label text="transaction #">                 </label>                 <t:template>                     <text text="{products>transactionnumber}"/>                 </t:template>             </t:column>         </t:columns>     </t:table> 

here's javascript try grab data.

  var table = this.byid('searchresultstable');       var aitems = table.getrows(); //this doesn't work        var cols = table.getcolumns(); //this works 

can point out i'm doing wrong here?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -