src/js/orb.ui.rows.js
function getUiInfo(infos, dimension) {
        if (dimension.values.length > 0) {

            var infosMaxIndex = infos.length - 1;
            var lastInfosArray = infos[infosMaxIndex];
            var parent = lastInfosArray.length > 0 ? lastInfosArray[lastInfosArray.length - 1] : null;

            for (var valIndex = 0; valIndex < dimension.values.length; valIndex++) {
                var subvalue = dimension.values[valIndex];
                var subdim = dimension.subdimvals[subvalue];

                var subTotalHeader;
                if (!subdim.isLeaf && subdim.field.subTotal.visible) {
                    subTotalHeader = new uiheaders.header(axe.Type.ROWS, uiheaders.HeaderType.SUB_TOTAL, subdim, parent, self.dataFieldsCount());
                } else {
                    subTotalHeader = null;
                }

                var newHeader = new uiheaders.header(axe.Type.ROWS, null, subdim, parent, self.dataFieldsCount(), subTotalHeader);

                if (valIndex > 0) {
                    infos.push((lastInfosArray = []));
                }

                lastInfosArray.push(newHeader);

                if (!subdim.isLeaf) {
                    getUiInfo(infos, subdim);
                    if (subdim.field.subTotal.visible) {
                        infos.push([subTotalHeader]);

                        // add sub-total data headers if more than 1 data field and they will be the leaf headers
                        addDataHeaders(infos, subTotalHeader);
                    }
                } else {
                    // add data headers if more than 1 data field and they will be the leaf headers
                    addDataHeaders(infos, newHeader);
                }
            }
        }
    }
function getUiInfo(infos, dimension) {
        if (dimension.values.length > 0) {

            var infosMaxIndex = infos.length - 1;
            var lastInfosArray = infos[infosMaxIndex];
            var parent = lastInfosArray.length > 0 ? lastInfosArray[lastInfosArray.length - 1] : null;

            for (var valIndex = 0; valIndex < dimension.values.length; valIndex++) {
                var subvalue = dimension.values[valIndex];
                var subdim = dimension.subdimvals[subvalue];

                var subTotalHeader;
                if (!subdim.isLeaf && subdim.field.subTotal.visible) {
                    subTotalHeader = new uiheaders.header(axe.Type.ROWS, uiheaders.HeaderType.SUB_TOTAL, subdim, parent, self.dataFieldsCount());
                } else {
                    subTotalHeader = null;
                }

                var newHeader = new uiheaders.header(axe.Type.ROWS, null, subdim, parent, self.dataFieldsCount(), subTotalHeader);

                if (valIndex > 0) {
                    infos.push((lastInfosArray = []));
                }

                lastInfosArray.push(newHeader);

                if (!subdim.isLeaf) {
                    getUiInfo(infos, subdim);
                    if (subdim.field.subTotal.visible) {
                        infos.push([subTotalHeader]);

                        // add sub-total data headers if more than 1 data field and they will be the leaf headers
                        addDataHeaders(infos, subTotalHeader);
                    }
                } else {
                    // add data headers if more than 1 data field and they will be the leaf headers
                    addDataHeaders(infos, newHeader);
                }
            }
        }
    }
function getUiInfo ( infos , dimension ) { if ( dimension . values . length > 0 ) { var infosMaxIndex = infos . length - 1 ; var lastInfosArray = infos [ infosMaxIndex ] ; var parent = lastInfosArray . length > 0 ? lastInfosArray [ lastInfosArray . length - 1 ] : null ; for ( var valIndex = 0 ; valIndex < dimension . values . length ; valIndex ++ ) { var subvalue = dimension . values [ valIndex ] ; var subdim = dimension . subdimvals [ subvalue ] ; var subTotalHeader ; if ( ! subdim . isLeaf && subdim . field . subTotal . visible ) { subTotalHeader = new uiheaders . header ( axe . Type . ROWS , uiheaders . HeaderType . SUB_TOTAL , subdim , parent , self . dataFieldsCount ( ) ) ; } else { subTotalHeader = null ; } var newHeader = new uiheaders . header ( axe . Type . ROWS , null , subdim , parent , self . dataFieldsCount ( ) , subTotalHeader ) ; if ( valIndex > 0 ) { infos . push ( ( lastInfosArray = [ ] ) ) ; } lastInfosArray . push ( newHeader ) ; if ( ! subdim . isLeaf ) { getUiInfo ( infos , subdim ) ; if ( subdim . field . subTotal . visible ) { infos . push ( [ subTotalHeader ] ) ; // add sub-total data headers if more than 1 data field and they will be the leaf headers addDataHeaders ( infos , subTotalHeader ) ; } } else { // add data headers if more than 1 data field and they will be the leaf headers addDataHeaders ( infos , newHeader ) ; } } } }
Fills the infos array given in argument with the dimension layout infos as row.
@param  {orb.dimension}  dimension - the dimension to get ui info for
@param  {object}  infos - array to fill with ui dimension info
Fills the infos array given in argument with the dimension layout infos as row .