1.view
<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:fb="sap.ui.comp.filterbar" xmlns:ui="sap.ui.table" xmlns:f="sap.f" xmlns:semantic="sap.f.semantic" controllerName=" 123">
<Page id="_IDGenPage1" titleAlignment="Start" title="errrr" enableScrolling="true" class="sapUiContentPadding">
<content>
<fb:FilterBar id="filterbar" reset="onReset" useToolbar="false" search="onFbGoPress" showGoOnFB="true">
<fb:filterGroupItems>
<fb:FilterGroupItem groupName="filtergrp" name="User" label="{i18n>1w}" visibleInFilterBar="true">
<fb:control>
<Input id="IP1" />
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="filtergrp" name="Sold" label="{i18n>er}" visibleInFilterBar="true">
<fb:control>
<Input id="IP2" />
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="filtergrp" name="Name" label="{i18n>gf}" visibleInFilterBar="true">
<fb:control>
<Input id="IP3" />
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="filtegrp" name="Flag" label="{i18n>gf}" visibleInFilterBar="true">
<fb:control>
<CheckBox id="CB1" />
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="filterp" name="Deletion" label="{i18n>gf}" visibleInFilterBar="true">
<fb:control>
<CheckBox id="CB2" />
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="filtergrp" name="contractName" label="{i18n>gg}" visibleInFilterBar="true">
<fb:control>
<!-- <DatePicker id="DP6" change="handleChange" value="{ 'type': 'sap.ui.model.type.Date', 'path': '/valueDP6', 'formatOptions': { 'pattern': 'yyyy-MM-dd ' } }" />
-->
<DateRangeSelection
id="DRS1"
placeholder="YYY/MM/DD-YYYY/MM/DD"
value="{
'type': 'sap.ui.model.type.DateInterval',
'formatOptions': {
'pattern': 'yyyy/MM/dd'
},
'parts': [
{
'type': 'sap.ui.model.type.Date',
'path': '/start'
},
{
'type': 'sap.ui.model.type.Date',
'path': '/end'
}
]
}"
change="handleChange"
/>
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="filtergrp" name="rName" label="{i18n>dByID}" visibleInFilterBar="true">
<fb:control>
<Input id="IP4" />
</fb:control>
</fb:FilterGroupItem>
</fb:filterGroupItems>
</fb:FilterBar>
<Table id="idTable" items="{crud>/}" paste="onPaste">
<headerToolbar>
<OverflowToolbar >
<Title text="{i18n>UserPrivileges}"/>
<ToolbarSpacer id="_IDGenToolbarSpacer1" />
<Button id="_IDGenButton1" text="Add" type="Emphasized" press="onaddpress" />
</OverflowToolbar>
</headerToolbar>
<columns>
<Column >
<Text text="{i18n>we}" />
</Column>
<Column >
<Text text="{i18n>Se}"/>
</Column>
<Column >
<Text text="{i18n>See}"/>
</Column>
<Column >
<Text text="{i18n>gg}"/>
</Column>
<Column >
<Text text="{i18n>gg}"/>
</Column>
<Column >
<Text text="{i18n>gg}" />
</Column>
<Column >
<Text text="{i18n>gg}" />
</Column>
<Column >
<Text text=" " />
</Column>
</columns>
<items>
<ColumnListItem >
<cells>
<Text text="{crud>gg}" />
<Text text="{crud>g}" />
<Text text="{crud>g}" />
<Text text="{crud>g}" />
<Text text="{crud>Dg}" />
<Text text="{path:'crud>f', type: 'sap.ui.model.type.DateTime' ,formatOptions: {
pattern: 'yyyy/MM/dd HH:mm:ss'
}}" />
<Text id="_IDGenText15" text="{crud>n}" />
<Button id="_IDGenButton2" press="onbuttonpress" icon="sap-icon://delete" visible="{=${crud>DELFLAG}==='X'?false:true}"/>
</cells>
</ColumnListItem>
</items>
</Table>
</content>
<footer>
<OverflowToolbar id="otbFooter">
<ToolbarSpacer id="_IDGenToolbarSpacer2" />
<Button id="_IDGenButton3" text="Save" type="Emphasized" press="onSave" />
</OverflowToolbar>
</footer>
</Page>
</mvc:View>
</content >
</Page>
</mvc:View>
2.controller onFbGoPress: function () {
var ui1 = this.getView().byId("IP1").getValue();
var stc1 = this.getView().byId("IP2").getValue();
var stpn1 = this.getView().byId("IP3").getValue();
var stdf1 = this.getView().byId("CB1").getSelected();
var df1 = this.getView().byId("CB2").getSelected();
var ubi1 = this.getView().byId("IP4").getValue();
var frmDt = this.getView().byId("DRS1").getFrom();
var toDt = this.getView().byId("DRS1").getTo();
var ofilters = [];
if (this.getView().byId("DRS1").getValue() != "" && this.getView().byId("DRS1").getValue() != " ") {
ofilters.push(new Filter("REGDATE", FilterOperator.GE, frmDt));
ofilters.push(new Filter("REGDATE", FilterOperator.LE, toDt));
}
if (ui1 != "") {
ofilters.push(new Filter("fdd", FilterOperator.Contains, ui1));
}
if (stc1 != "") {
ofilters.push(new Filter("ffff", FilterOperator.Contains, stc1));
}
if (stpn1 != "") {
ofilters.push(new Filter("f_NuM", FilterOperator.Contains, stpn1));
}
if (stdf1 != false) {
ofilters.push(new Filter("fFLG", FilterOperator.EQ, "X"));
}
if (df1 != false) {
ofilters.push(new Filter("ffG", FilterOperator.EQ, "X"));
}
if (ubi1 != "") {
ofilters.push(new Filter("UPDUfffSER", FilterOperator.Contains, ubi1));
}
var id = this.getView().byId("idTable");
var oBinding = id.getBinding("items");
oBinding.filter(new Filter(ofilters, true));
}
No comments:
Post a Comment