Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Count table rows UI5 , XML view

$
0
0

Hello,

 

I want to count ( find the number of rows in a table , or in my model ) .

I have a model ( json ) and i apply this model to a table. I tried to find how many rows I have in my table but i couldn't.

Can you help me ? 

The view ( xml ) looks like this :

<Table id="doc_table"

    inset="false"

    items="{

      path: '/Documents',

      sorter: {

        path: 'Document_Id'

      }

    }"

    >

    <headerToolbar>

      <Toolbar>

        <Label text="Products"></Label>

      </Toolbar>

    </headerToolbar>

    <columns>

      <Column

        width="12em">

        <Label text="Document_id" />

      </Column>

      <Column

        minScreenWidth="Tablet"

        demandPopin="true">

        <Label text="Partner_id" />

      </Column>

      <Column

        minScreenWidth="Tablet"

        demandPopin="true"

        hAlign="Right">

        <Label text="PolicyNr" />

      </Column>

      <Column

        minScreenWidth="Tablet"

        demandPopin="true"

        hAlign="Center">

        <Label text="RepvalDescr" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="RepvalType" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="Reportbeg" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="Reportend" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="Repval" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="Repdate" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="DueDate" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="Currency" />

      </Column>

      <Column

        hAlign="Right">

        <Label text="Submit" />

      </Column>

    </columns>

    <items>

      <ColumnListItem>

        <cells>

          <Text

            text="{Document_Id}" />

          <Text

            text="{Partner_Id}" />

          <Text

            text="{PolicyNr}" />

          <Text

            text="{RepvalDescr}"/>

          <Text

          text="{RepvalType}" />

          <Text

            text="{Reportbeg}" />

          <Text

            text="{Reportend}" />

          <Text

            text="{Repval}" />

          <Text

            text="{Repdate}"/>

          <Text

          text="{DueDate}" />

          <Text

            text="{Currency}"/>

          <Text

          text="{Submit}" />

        </cells>

      </ColumnListItem>

    </items>

  </Table>

 

 

and in the controller ( .js ) i tried a lot of things , none with good results :

var rowsd = view.getElementById("doc_table").getElementsByTagName("tbody")[0].getElementsByTagName("tr").length;

var rows = this.getView().byId("doc_table").getElementsByTagName("tbody").length;

table.getBinding("items").filter(oFilter).length;

 

I tried all that i found ,,, but nothing works .

 

Thank you !


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>