leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Mapping to a Filtered data

In my app I have names of persons with their corresponding photos. I have 2 filtering pages. On one page I want to filter to a result page based on the match for a search name. On the other I want to filter to the result page based on the names that correspond to the first or last names of the alphabet clicked. I am having trouble mapping to get the names and pictures to display on the results page.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping to a Filtered data

Could you clarify please what is the exact problem you have? Are there any errors in console?

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Mapping to a Filtered data

No error. I have mapped to get all names and their pictures to show up. I'm asking how to map to get filtered results to display names and pictures only for the names matching the input for search in one case, or the names starting with the alphabet clicked for the other case.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping to a Filtered data

Could you show us your mapping screenshot?

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Mapping to a Filtered data

Image

This is the start screen. The page having filtered result has no mapping.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping to a Filtered data

Thank's, I'll update.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Mapping to a Filtered data

Hello,

According to Tiggzi design, data is filtrated in Rest Service. Mapping is for displaying data only.

If you need to delete some items in mapping settings you can click "Add JS" or "Edit JS" in front of the filtering field:
Image

Add the following JavaScript code:
codeif(value.indexOf("a") != -1) {
element.closest("table").hide();
}

return value;/code

All the data containing "a" will be hidden.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Mapping to a Filtered data

Yes, but in this case I'm navigating to another page to display the filtered list. I am getting all the names again on the other page. I have shared the project so you can examine it. Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping to a Filtered data

1) On startScreen--searchButton--Click--Navigate to page should be the last event;

2) On Filtered page-- Load -- Run JavaScript replace alert codealert("Ho" +sid);/code with the next one codealert("Ho" +localStorage.getItem("sid"));/code

3) On startScreen and Filtered delete mapping to Request (it doesn't affect anything)

4) On Filtered page in restservice2 mapping from fn to filteredName --Text add next JS

codeif(value.indexOf(localStorage.getItem("sid")) === -1) {
element.closest("table").hide();
}
return value;/code

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Mapping to a Filtered data

Bravo! Works great.
Just for further understanding:

  1. When is it necessary to do a mapping to Request?
  2. If there are no match for the search I want to display a message on a Label component that there is no match. I know the label would first be set to visible off initially. How can I set the text to it and set it visible?
  3. Is there a place with help info on these kind of items?

Return to “Issues”