For Removing all contents Of The Table and Page

For Removing all Items Of  The Table:

View:

<content>
<Table id="table_Id" items="{/data}"  growing="true" growingThreshold="12" growingScrollToLoad="false">
<headerToolbar>
<Toolbar>
<Button icon="sap-icon://refresh" type="Emphasized"/>
<ToolbarSpacer/>
<SearchField width="30%" liveChange="TliveChange" id="TsearchId" />
<Button icon="sap-icon://filter" type="Emphasized" press="onFilter"/>
<Button icon="sap-icon://add" type="Accept"/>
</Toolbar>
</headerToolbar>
<columns>
<Column width="8em" demandPopin="true">
<Text text="DRS No"/>
</Column>
<Column width="15em">
<Text text="Article"/>
</Column>
<Column width="8em" demandPopin="true">
<Text text="Date"/>
</Column>
<Column width="8em" demandPopin="true">
<Text text="Status"/>
</Column>
<Column width="8em" demandPopin="true">
<Text text="Quantity"/>
</Column>
<Column width="8em" demandPopin="true">
<Text text="Received qty"/>
</Column>

<Column demandPopin="true">
<Text text=""/>
</Column>
<Column demandPopin="true">
<Text text=""/>
</Column>
<Column demandPopin="true">
<Text text=""/>
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<ObjectStatus text="{DRS Number}" state="{path :'Status', formatter:'mockupapp.view.formatter.statue'}"/>
</cells>
<cells>
<Text text="{Article}"/>
</cells>
<cells>
<Text text="{Date}"/>
</cells>
<cells>
<Text text="{Status}"/>

</cells>
<cells>
<Text text="{Quantity}"/>
</cells>
<cells>
<Text text="{Received qty}"/>
</cells>
<cells>
<Button id="productInput" visible="{path :'Status', formatter:'mockupapp.view.formatter.visible'}" icon="sap-icon://display" type="Emphasized" press="handleValueHelp"/>

</cells>
<cells>
<Button  id="productInput1" visible="{path :'Status', formatter:'mockupapp.view.formatter.visible1'}"  icon="sap-icon://edit" type="Accept" press="onEdit"/>
</cells>
<cells>
<Button id="productInput2"   visible="{path :'Status', formatter:'mockupapp.view.formatter.visible2'}" icon="sap-icon://delete" type="Reject" press="onDelete"/>
</cells>
</ColumnListItem>
</items>
</Table>
</content>




Controller.js


onInit: function(oEvent) {
var oModel=new sap.ui.model.json.JSONModel("model/Sdata.json");
this.getView().byId("table_Id").setModel(oModel);

},

onDelete:function(oEvent){
oEvent.getSource().getParent().getParent().removeAllItems();
}

Post a Comment

Previous Post Next Post