cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 remove row thoughs "Uncaught TypeError: oModelData.splice is not a function"

0 Kudos

Hi all,

I got an issue with the "sap.ui.table".

I created a XML view and want to remove a row.

In the internet I found only examples with JS-views. So I try to adopt the coding to my example.

On https://archive.sap.com/discussions/thread/3578776

I found for removing/deleting a row:

var data = oModel.getData();
data.splice(index,1); 

As you can see oModelData is an array of 5 Products:

But the following line throws an error:

I don't have any idea why this is not working for me?

Thanks

Regards

Mario

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor
0 Kudos

Its oModelData.Produucts.splice()... That is not an array and it's an object and that is the reason why splice is not working.. but the object has Products property, which is an array and here you need to apply splice.

BR

Mahesh

Answers (3)

Answers (3)

junwu
Active Contributor

oModelData.Products.splice

0 Kudos

Hi Mahesh,

thanks for the hint. But I was searching for the button "answered". How do I do that?

Kind regards

Mario

0 Kudos

Thank you all! Problem solved!

Regards Mario

maheshpalavalli
Active Contributor
0 Kudos

You can close this question by marking one answer as answered