Reputation: 75
I am trying to extend SAPUI5 TreeTable. In the simplest form my extended table looks like this:
jQuery.sap.declare("my.app.ExtendedTable");
jQuery.sap.require("sap.ui.table.library");
jQuery.sap.require("sap.ui.table.TreeTable");
sap.ui.table.TreeTable.extend('my.app.ExtendedTable', {});
So I am not really adding any new properties or overriding any methods yet, until the basics work.
If I place it on my XML view as an empty table, the view is rendered (namespace "my" refers to the namespace of the extended table ("my.app" as above), and "table" refers to "sap.ui.table").
But if I start adding columns to it, I am getting error: "Uncaught Error: failed to load 'sap/ui/table/columns.js' from ..."
<my:ExtendedTable>
<table:columns>
</table:columns>
</my:ExtendedTable>
So it somehow can't inherit the columns-aggregation from the sap.ui.table.Table, but tries to find a class for it. I have spent few days now with this issue, trying to read the SAPUI5 instructions again and again, and trying to search for samples that could help, but without any luck. Any ideas what is wrong here? What am I missing?
Upvotes: 2
Views: 1867
Reputation: 4920
since the aggregation is part of your extended control, I would assume it should work like this:
<my:ExtendedTable>
<my:columns>
<table:Column width="100px">
<table:label><Label text="{something}" /></table:label>
<table:template><TextView text="{somethingElse}" /></table:template>
</table:Column>
</my:columns>
</my:ExtendedTable>
Upvotes: 1