src/aria/widgets/form/list/ListController.js
function (flowOrientation, numberOfRows, numberOfCols, noItems) {
            var numItemsLastCol;

            if (flowOrientation == 'vertical') {

                if (!numberOfRows) {
                    if (numberOfCols) {
                        numberOfRows = Math.ceil(noItems / numberOfCols);
                        // Now make sure the number of cols they've passed is correct
                        numberOfCols = Math.ceil(noItems / numberOfRows);
                    } else {
                        numberOfCols = 1;
                        numberOfRows = noItems;
                    }
                } else {
                    numberOfCols = Math.ceil(noItems / numberOfRows);
                    numItemsLastCol = noItems % numberOfRows;

                }
            } else if (flowOrientation == 'horizontal') {
                if (!numberOfCols) {
                    if (numberOfRows) {
                        numberOfCols = Math.ceil(noItems / numberOfRows);
                        // Now make sure the number of rows they've passed is correct
                        numberOfRows = Math.ceil(noItems / numberOfCols);
                    } else {
                        numberOfRows = 1;
                        numberOfCols = noItems;
                    }
                } else {
                    numberOfRows = Math.ceil(noItems / numberOfCols);
                }
            }

            this.json.setValue(this._data, "numberOfRows", numberOfRows);
            this.json.setValue(this._data, "numberOfColumns", numberOfCols);
        }
function (flowOrientation, numberOfRows, numberOfCols, noItems) {
            var numItemsLastCol;

            if (flowOrientation == 'vertical') {

                if (!numberOfRows) {
                    if (numberOfCols) {
                        numberOfRows = Math.ceil(noItems / numberOfCols);
                        // Now make sure the number of cols they've passed is correct
                        numberOfCols = Math.ceil(noItems / numberOfRows);
                    } else {
                        numberOfCols = 1;
                        numberOfRows = noItems;
                    }
                } else {
                    numberOfCols = Math.ceil(noItems / numberOfRows);
                    numItemsLastCol = noItems % numberOfRows;

                }
            } else if (flowOrientation == 'horizontal') {
                if (!numberOfCols) {
                    if (numberOfRows) {
                        numberOfCols = Math.ceil(noItems / numberOfRows);
                        // Now make sure the number of rows they've passed is correct
                        numberOfRows = Math.ceil(noItems / numberOfCols);
                    } else {
                        numberOfRows = 1;
                        numberOfCols = noItems;
                    }
                } else {
                    numberOfRows = Math.ceil(noItems / numberOfCols);
                }
            }

            this.json.setValue(this._data, "numberOfRows", numberOfRows);
            this.json.setValue(this._data, "numberOfColumns", numberOfCols);
        }
function ( flowOrientation , numberOfRows , numberOfCols , noItems ) { var numItemsLastCol ; if ( flowOrientation == 'vertical' ) { if ( ! numberOfRows ) { if ( numberOfCols ) { numberOfRows = Math . ceil ( noItems / numberOfCols ) ; // Now make sure the number of cols they've passed is correct numberOfCols = Math . ceil ( noItems / numberOfRows ) ; } else { numberOfCols = 1 ; numberOfRows = noItems ; } } else { numberOfCols = Math . ceil ( noItems / numberOfRows ) ; numItemsLastCol = noItems % numberOfRows ; } } else if ( flowOrientation == 'horizontal' ) { if ( ! numberOfCols ) { if ( numberOfRows ) { numberOfCols = Math . ceil ( noItems / numberOfRows ) ; // Now make sure the number of rows they've passed is correct numberOfRows = Math . ceil ( noItems / numberOfCols ) ; } else { numberOfRows = 1 ; numberOfCols = noItems ; } } else { numberOfRows = Math . ceil ( noItems / numberOfCols ) ; } } this . json . setValue ( this . _data , "numberOfRows" , numberOfRows ) ; this . json . setValue ( this . _data , "numberOfColumns" , numberOfCols ) ; }
Calculates the number of columns and rows a list should have based on the flow
@protected
@param {String} flowOrientation Orientation of list whether 'horizontal' or 'verticle'
@param {Number} numberOfRows The number of Rows
@param {Number} numberOfCols The number of Columns
@param {Number} noItems The number of Items
Calculates the number of columns and rows a list should have based on the flow