src/Xmla.js
function(ordinal){
        var cellNodes = this._cellNodes,
            n = cellNodes.length,
            index = Math.min(ordinal, n-1),
            cellOrdinal, node
        ;
        while(index >= 0) {
            //get the node at the current index
            node = cellNodes[index];
            cellOrdinal = this._getCellOrdinal(node);
            if (cellOrdinal === ordinal) {
              return index;
            }
            else
            if (cellOrdinal > ordinal) {
              index--;
            }
            else {
              return -1;
            }
        }
        return -1;
    }
function(ordinal){
        var cellNodes = this._cellNodes,
            n = cellNodes.length,
            index = Math.min(ordinal, n-1),
            cellOrdinal, node
        ;
        while(index >= 0) {
            //get the node at the current index
            node = cellNodes[index];
            cellOrdinal = this._getCellOrdinal(node);
            if (cellOrdinal === ordinal) {
              return index;
            }
            else
            if (cellOrdinal > ordinal) {
              index--;
            }
            else {
              return -1;
            }
        }
        return -1;
    }
function ( ordinal ) { var cellNodes = this . _cellNodes , n = cellNodes . length , index = Math . min ( ordinal , n - 1 ) , cellOrdinal , node ; while ( index >= 0 ) { //get the node at the current index node = cellNodes [ index ] ; cellOrdinal = this . _getCellOrdinal ( node ) ; if ( cellOrdinal === ordinal ) { return index ; } else if ( cellOrdinal > ordinal ) { index -- ; } else { return - 1 ; } } return - 1 ; }
Get the physical cell index for the specified ordinal number.
This method is useful to calculate boundaries to retrieve a range of cells.
@method indexForOrdinal
@param {int} ordinal - the ordinal number for which the index shoul dbe returned
@return {int} The physical index.
Get the physical cell index for the specified ordinal number . This method is useful to calculate boundaries to retrieve a range of cells .