Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to sort scrollView chidren

$
0
0

Is there a way to sort the children of scrollView?

var row1 = Ti.UI.createView({
            myID: id
          });
 
scrollView.add(row1);
scrollView.add(row2);
scrollView.add(row3);
 
scrollView.children.sort(function(a, b) {
                    var idA = a.myID;
                    var idB = b.myID;
                    return (idA < idB) ? -1 : (idA > idB) ? 1 : 0;
                });

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>