on 06-03-2016 5:23 AM
Hi,
I have created a Tree table in a fragment, and binded the data using JSON Model.
I am fetching the metadata content from a OData service and putting it in a JSON Model, and in the table having the parent as the Entity type and the child being the Properties of the same. This being the first column of the Tree table. Further columns have Combo Box, text areas, check box. And what ever data I enter in the input columns does not move when I scroll through the table vertically.
As you can see in the first image I have entered certain data , and it is still there when in the second image when the scroll bar is at a different place.
Any advice will be appreciated.
Thanks
Hi Vaibhav,
Share your view code.
Regards,
Viswa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Controller code for model creation and binding :
_getDialog: function(){
if(!this._oDialog){
this._oDialog = sap.ui.xmlfragment("sap.smartbusiness.ui.hcp.designtime.ODataConfiguration.view.oDataConfig", this);
this.getView().addDependent(this._oDialog);
}
var url=this.getView().byId("idUrl").getValue();
url = this.metadataRef.getFormattedUrl(url, "BusinessSystem03");
var model=new sap.ui.model.odata.ODataModel(url);
var meta=model.getMetaModel().oModel.oData.dataServices.schema[0].entityType;
var data= {};
data.entityType=[];
jQuery.each(meta,function(i,entity){
data.entityType.push({"name":entity.name, "entityType": null, "semantics":[{"key":"key1", "value":"parameters"},{"key":"key2", "value":"aggregate"}]});
data.entityType[i].entityType=[]
var text=[];
jQuery.each(entity.property,function(index,property){
data.entityType[i].entityType.push({"name":property.name,
"semantics":[{"key":"key1", "value":"currency-code"},{"key":"key2", "value":"unit-of-measure"}],
"label":"true",
"filter":"false",
"sort":"false",
"aggregation-role":[{"key":"key3", "value":"dimension"},{"key":"key4", "value":"measure"}],
"text":"true"})
text.push({"value":property.name});
})
jQuery.each(data.entityType[i].entityType, function(i, obj){
obj.text=text;
})
})
var oModel=new sap.ui.model.json.JSONModel(data);
sap.ui.getCore().byId("idTable").setModel(oModel);
return this._oDialog;
}
View :
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:form="sap.ui.layout.form"
xmlns:table="sap.ui.table"
xmlns:smartTable="sap.ui.comp.smarttable">
<P13nDialog cancel="handleCancelPress"
title="OData Configuration"
stretch="true">
<table:TreeTable id="idTable" rows="{path:'/', parameters:{arrayNames:['entityType']}}"
rowSelectionChange="onRowSelect"
enableSelectAll="true"
enableColumnReordering="true">
<table:toolbar>
<Toolbar>
<Title text="Configurator" />
<ToolbarSpacer/>
<Button text="Collapse All" press="onCollapseAll"/>
<Button text="Expand" press="onExpandFirstLevel"/>
</Toolbar>
</table:toolbar>
<table:columns>
<table:Column>
<Label text="Entity Types"/>
<table:template>
<Text text="{name}" />
</table:template>
</table:Column>
<table:Column>
<Label text="Semantics"/>
<table:template>
<ComboBox id="semanticId" items="{semantics}" selectionChange="onSemanticSelect">
<items>
<core:Item key="{key}" text="{value}"/>
</items>
</ComboBox>
</table:template>
</table:Column>
<table:Column>
<Label text="Label"/>
<table:template>
<Input id="labelId" visible="{=!!${label}}"/>
</table:template>
</table:Column>
<table:Column>
<Label text="Filterable"/>
<table:template>
<CheckBox id="filterId" visible="{=!!${filter}}">
</CheckBox>
</table:template>
</table:Column>
<table:Column>
<Label text="Sortable"/>
<table:template>
<CheckBox id="sortId" visible="{=!!${sort}}">
</CheckBox>
</table:template>
</table:Column>
<table:Column>
<Label text="Aggregation Role"/>
<table:template>
<ComboBox id="aggregationId" items="{aggregation-role}" visible="{= !!${aggregation-role}}">
<items>
<core:Item key="{key}" text="{value}"/>
</items>
</ComboBox>
</table:template>
</table:Column>
<table:Column>
<Label text="Text"/>
<table:template>
<ComboBox id="textId" items="{text}" visible="{= !!${text}}">
<items>
<core:Item text="{value}"/>
</items>
</ComboBox>
</table:template>
</table:Column>
<table:Column>
<Label text="Unit"/>
<table:template>
<ComboBox id="unitId" items="{text}" visible="{= !!${text}}">
<items>
<core:Item text="{value}"/>
</items>
</ComboBox>
</table:template>
</table:Column>
</table:columns>
</table:TreeTable>
</P13nDialog>
</core:FragmentDefinition>
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.