Set default value for custom filter in smart filter
up vote
0
down vote
favorite
I am new to SAP UI5, created SAP Fiori App using template(List Report).
I have created a custom filter in smart filter using Fragment:
<smartfilterbar:ControlConfiguration id= "SmartFilterBar" key="Customfilter"
index="1" label="Days" visible="true"
visibleInAdvancedArea="true" groupId="_BASIC">
<smartfilterbar:customControl>
<core:Title id= "SmartFilter" text="Days" />
<Label text="Days"/>
<Input id="Days"
type="Text">
<core:Item text="Days" />
</Input>
</smartfilterbar:customControl>
</smartfilterbar:ControlConfiguration>
Now the requirement is to set default value of this customfilter(Days).
In controller on event onBeforeRendering, i am trying to get the smartfilter and using setfilterdata function:
onBeforeRendering: function()
{
var oSmartFilter = this.getView().byId("SmartFilter");
var oJSONData =
Days:
operator: "EQ",
low:"5";
oSmartFilter.setFilterData(oJSONData, true);
but when Fiori app loads it doesn't give any error nor set default value.
Any help/suggestion will be helpful.
Thanks in advance.
Monika
javascript jquery view fragment
add a comment |
up vote
0
down vote
favorite
I am new to SAP UI5, created SAP Fiori App using template(List Report).
I have created a custom filter in smart filter using Fragment:
<smartfilterbar:ControlConfiguration id= "SmartFilterBar" key="Customfilter"
index="1" label="Days" visible="true"
visibleInAdvancedArea="true" groupId="_BASIC">
<smartfilterbar:customControl>
<core:Title id= "SmartFilter" text="Days" />
<Label text="Days"/>
<Input id="Days"
type="Text">
<core:Item text="Days" />
</Input>
</smartfilterbar:customControl>
</smartfilterbar:ControlConfiguration>
Now the requirement is to set default value of this customfilter(Days).
In controller on event onBeforeRendering, i am trying to get the smartfilter and using setfilterdata function:
onBeforeRendering: function()
{
var oSmartFilter = this.getView().byId("SmartFilter");
var oJSONData =
Days:
operator: "EQ",
low:"5";
oSmartFilter.setFilterData(oJSONData, true);
but when Fiori app loads it doesn't give any error nor set default value.
Any help/suggestion will be helpful.
Thanks in advance.
Monika
javascript jquery view fragment
Maybe it would help debugging the issue if you create a working sample in a tool like next.plnkr.co
– SAP Fiori Crew
Nov 12 at 17:22
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am new to SAP UI5, created SAP Fiori App using template(List Report).
I have created a custom filter in smart filter using Fragment:
<smartfilterbar:ControlConfiguration id= "SmartFilterBar" key="Customfilter"
index="1" label="Days" visible="true"
visibleInAdvancedArea="true" groupId="_BASIC">
<smartfilterbar:customControl>
<core:Title id= "SmartFilter" text="Days" />
<Label text="Days"/>
<Input id="Days"
type="Text">
<core:Item text="Days" />
</Input>
</smartfilterbar:customControl>
</smartfilterbar:ControlConfiguration>
Now the requirement is to set default value of this customfilter(Days).
In controller on event onBeforeRendering, i am trying to get the smartfilter and using setfilterdata function:
onBeforeRendering: function()
{
var oSmartFilter = this.getView().byId("SmartFilter");
var oJSONData =
Days:
operator: "EQ",
low:"5";
oSmartFilter.setFilterData(oJSONData, true);
but when Fiori app loads it doesn't give any error nor set default value.
Any help/suggestion will be helpful.
Thanks in advance.
Monika
javascript jquery view fragment
I am new to SAP UI5, created SAP Fiori App using template(List Report).
I have created a custom filter in smart filter using Fragment:
<smartfilterbar:ControlConfiguration id= "SmartFilterBar" key="Customfilter"
index="1" label="Days" visible="true"
visibleInAdvancedArea="true" groupId="_BASIC">
<smartfilterbar:customControl>
<core:Title id= "SmartFilter" text="Days" />
<Label text="Days"/>
<Input id="Days"
type="Text">
<core:Item text="Days" />
</Input>
</smartfilterbar:customControl>
</smartfilterbar:ControlConfiguration>
Now the requirement is to set default value of this customfilter(Days).
In controller on event onBeforeRendering, i am trying to get the smartfilter and using setfilterdata function:
onBeforeRendering: function()
{
var oSmartFilter = this.getView().byId("SmartFilter");
var oJSONData =
Days:
operator: "EQ",
low:"5";
oSmartFilter.setFilterData(oJSONData, true);
but when Fiori app loads it doesn't give any error nor set default value.
Any help/suggestion will be helpful.
Thanks in advance.
Monika
javascript jquery view fragment
javascript jquery view fragment
asked Nov 9 at 6:40
monika juyal
1
1
Maybe it would help debugging the issue if you create a working sample in a tool like next.plnkr.co
– SAP Fiori Crew
Nov 12 at 17:22
add a comment |
Maybe it would help debugging the issue if you create a working sample in a tool like next.plnkr.co
– SAP Fiori Crew
Nov 12 at 17:22
Maybe it would help debugging the issue if you create a working sample in a tool like next.plnkr.co
– SAP Fiori Crew
Nov 12 at 17:22
Maybe it would help debugging the issue if you create a working sample in a tool like next.plnkr.co
– SAP Fiori Crew
Nov 12 at 17:22
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53220970%2fset-default-value-for-custom-filter-in-smart-filter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Maybe it would help debugging the issue if you create a working sample in a tool like next.plnkr.co
– SAP Fiori Crew
Nov 12 at 17:22