Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SAPUI5 get oData model from table binding

I have binded a Table using oData like below.

<Table id="myTableID" 
            class="sapUiResponsiveMargin" 
            items="{Items}"
            noDataText="{i18n>NoDataText}" 
            updateFinished="onUpdateFinished"
            width="auto">

Now I need to retrieve this oData model from the view rather than calling the web service again.

I have tried the below,

var path = this.getView().getElementBinding().getPath();
var oModel = this.getView().getModel();

which returns the model from the parent view.

Is there a way to achieve this?

like image 441
harini88 Avatar asked Nov 30 '25 06:11

harini88


1 Answers

Just use this.getView().byId("myTableID").getModel();

like image 167
Qualiture Avatar answered Dec 04 '25 08:12

Qualiture



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!