on 04-10-2015 5:36 AM
Hi All,
I been able to use filters in JS views but facing issues on how to use them in XML views. If anybody have any idea about the same.. please do share your valuable comments.
Thanks,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashwin,
In view.xml create 1 input and change event,
in controller get that value and do filter like this below link,
SAPUI5: How to filter data with 2 or more values - Stack Overflow
hi Ashwin,
there is a filter tab in my master view like the below..
<subHeader>
<Bar>
<contentLeft>
<SearchField search="handleSearch" width="100%">
</SearchField>
</contentLeft>
</Bar>
</subHeader>
i will call the function handleSearch in my controller in which i will write filter logic as below..
handleSearch : function (evt) {
// create model filter
var filters = [];
var query = evt.getParameter("query");
if (query && query.length > 0) {
var filter = new sap.ui.model.Filter("SoId",
sap.ui.model.FilterOperator.Contains, query);
filters.push(filter);
}
// update list binding
var list = this.getView().byId("list");
var binding = list.getBinding("items");
binding.filter(filters);
},
In this SoId(which you want to filter) is some large number which i am entering in the search feild.. based on the entered number the number list in my master view will be filtered and updated..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
This is not working for me. The scenario is I have a combobox which is populated,,, let's suppose with the name of an employee, for the combobox i have to use filter like his ID to get his name which i have to do dynamically. Then depending upon which name is selected in the combobox I have to populate the table with employee details, which is again a filter according to the value selected from the combobox...I have services for all these fumctionalities...achieved the same in JS view but facing issues in XML views... Any suggestions??
Thanks,
Ashwin
See this example,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.