Show selected ionic list view


#1

I have created this (demo) to demonstrate my problem. In this demo, I have a list page, a button at the header when the checkbox attribute is checked, a list view and also a checkbox next to my list view. I want to be able to show the selected list on my home.html when the submit button is click. I am not sure how to do that. Help will be appreciated.


#2

use a service or factory to store your checked data, because services are there to provide shared data to multiple module components like controllers.

You did something like that in you WebAPI-Factory. You could write all checked in this factory if you click on “Submit” like
WebAPI.selectedData = // here the array with selected data


#3

I did the similar function days ago, you can push you data into a array just like bellow codes

  for (var i = 0; i < $scope.selectHistoryCurveArea.length; i++) {
        if ($scope.selectHistoryCurveArea[i].isChecked) {
            selectedHistoryCurvePoints.push($scope.selectHistoryCurveArea[i].SpotName);
            selectedHistoryCurvePointsID.push($scope.selectHistoryCurveArea[i].SpotId);
        };
    };

#4

Hi Jeffreycolbert, thank you for your reply. Can you edited on my codepen? It is because I am not what is your selectHistoryCurveArea and sportname and stuff like that. Thanks. :smile:


#5

Hi bengtler, I have something like this http://codepen.io/Hin/pen/VLVLrJ, can you edit my code in codepen?
thanks :slight_smile:


#7

but the laziness most of the ionic forum users is tooo dammn high


#8

nice work, Thanks a lot! :smile:


#9

Ok,Just take a look here http://codepen.io/HelloYu/pen/vOQNXX


#10

Nice work jeffrey, thank you for your help as well :slight_smile: