Video tutorial for counting total rows having different section with Alloy using Titanium


Introduction : Table view may contain different sections where each of those section may contain several rows.
Here I am describing the way to calculate total number of rows present in a tableview which have different section.

Code Block :

View : index.xml

Controller : Index.js

function showTotalRow(){
var allSection = $.tbl.data;
var totalRows = 0;
var count = 0;

for(count = 0; count < allsection.length; count++){
totalRows = allSection[count].rowCount;
}

alert('Total Rows : ' + totalRows);
}

Summary :
Now onwards easily we can get the total number of rows present on a table view with Alloy using Titanium.

THAT'S IT

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s