sapui5 - Get the model when clicking a button on a table row -


I have a SAPUI5 table tied with simple model, I am printing data using the SAPUI5 table control . I am binding the name field with the name of the table on the control name and on the next column I have a button. When you press this button I want to do some operation on the model (Read) However, I can not understand the way to get a model example in the callback function for the button.

Here is the problem to reproduce.

The answer to this problem is thanks to a user from the SAP community.

Press is the updated code for event handlers which resolves the current model

  var button = new SAP .ui.commons.Button ({text: "button", press: function (e) {var model = this.getModel (); var path = e.getSource (). GetBindingContext (.). GetPath (); Var obj = Model.getProperty (path); console.log (obj);}});    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -