How to find the OData model version from the sap.ui.table.Table instance

Steps to be followed:

  1. Get the instance of table sap.ui.table.Table
  2. Get the Binding instance using the getBinding method of table instance
  3. Get the path of the OData Model using the getPath method of the ODataListBinding
  4. Get the model instance using the getModel() method of the ODataListBinding
  5. The OData version is defined in the metadata. so using the getMetadata() method of the model instance, the OData version can be determined
var bindingInstance = uiTableInstance.getBinding('rows')
var sPathOfModel = uiTableInstance.getBinding('rows').getPath()
var modelInstance = uiTableInstance.getBindng('rows').getModel(sPathOfModel)
modelInstance.getMetadata() ===> This will get the sap.ui.model.odata.v2.ODataModel version.