cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m Table dynamically in XML

Former Member
0 Kudos

Hi Experts,

I need to create one sap.m Table dynamically.Row,Column & Data all should bind dynamically.I need to add all the properties - sort, filter, grouping.

We need to create it in xml view only rather than using javascript from controller.

We already achieved the same thing using javascript - Dynamic columns for a Table | SCN.

We need solution in xml only.

Can you please help me.

Thanks,

Patralekha

Accepted Solutions (0)

Answers (1)

Answers (1)

saurabh_vakil
Active Contributor
0 Kudos

Hi,

What have you tried so far and where are you getting stuck up?

Regards,

Saurabh

Former Member
0 Kudos

Hi we have tried this till now...

<Table id="idtable"

        type="Active"

        itemPress="getdetails"

        columns="{/header}"

        items="{/root}">

      

        <columns>

          <Column

            width="12em">

            <Label text="{hdr}" />

          </Column>

      

        </columns>

        <items>

          <ColumnListItem type="Active" id="colitems">

            <cells>

             <Text text="{Name}"/>

            <Text text="{psno}"/>

            <Text text="{grade}"/>

         

            </cells>

          </ColumnListItem>

        </items>

</Table> 

Here is my JSON:

{

"root":[

{

"Name":"Athul","psno":"10618171","grade":"SET"

},

{

"Name":"Vineeth","psno":"10618030","grade":"SET"

},

{

"Name":"Sonal","psno":"10618038","grade":"SET"

}

],

"header":[

{"hdr":"Name"},{"hdr":"psno"},{"hdr":"grade"}

]

}

Now I want my row values also to be dynamic.In my code I have already fixed my row values according to the number of columns I have.

Regards

Athul R

SergioG_TX
Active Contributor
0 Kudos

Athul,

after you get the model bind to the table, you need to change your Text field to Input control and its editable property of the input should be true so you can change the model dynamically.. such as

<Input value={Name} editable=true />

hope this helps you