Skip to Content

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

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

capture00.png (86.0 kB)
capture.png (112.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Feb 15 at 05:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 15 at 05:30 AM

    oModelData.Products.splice

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 15 at 10:08 AM

    Thank you all! Problem solved!

    Regards Mario

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 15 at 11:06 AM

    Hi Mahesh,

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

    Kind regards

    Mario

    Add comment
    10|10000 characters needed characters exceeded