function fill() {

        if (self.pgrid.filteredDataSource != null && self.dimensionsCount > 0) {

            var datasource = self.pgrid.filteredDataSource;
            if (datasource != null && utils.isArray(datasource) && datasource.length > 0) {
                for (var rowIndex = 0, dataLength = datasource.length; rowIndex < dataLength; rowIndex++) {
                    var row = datasource[rowIndex];
                    var dim = self.root;
                    for (var findex = 0; findex < self.dimensionsCount; findex++) {
                        var depth = self.dimensionsCount - findex;
                        var subfield = self.fields[findex];
                        var subvalue = row[subfield.name];
                        var subdimvals = dim.subdimvals;

                        if (subdimvals[subvalue] !== undefined) {
                            dim = subdimvals[subvalue];
                        } else {
                            dim.values.push(subvalue);
                            dim = new Dimension(++dimid, dim, subvalue, subfield, depth, false, findex == self.dimensionsCount - 1);
                            subdimvals[subvalue] = dim;
                            dim.rowIndexes = [];
                            self.dimensionsByDepth[depth].push(dim);
                        }

                        dim.rowIndexes.push(rowIndex);
                    }
                }
            }
        }
    }
/**
     * Creates all subdimensions using the supplied data
     */
Creates all subdimensions using the supplied data
Creates all subdimensions using the supplied data
function fill() {
        if (self.pgrid.filteredDataSource != null && self.dimensionsCount > 0) {
            var datasource = self.pgrid.filteredDataSource;
            if (datasource != null && utils.isArray(datasource) && datasource.length > 0) {
                for (var rowIndex = 0, dataLength = datasource.length; rowIndex < dataLength; rowIndex++) {
                    var row = datasource[rowIndex];
                    var dim = self.root;
                    for (var findex = 0; findex < self.dimensionsCount; findex++) {
                        var depth = self.dimensionsCount - findex;
                        var subfield = self.fields[findex];
                        var subvalue = row[subfield.name];
                        var subdimvals = dim.subdimvals;
                        if (subdimvals[subvalue] !== undefined) {
                            dim = subdimvals[subvalue];
                        } else {
                            dim.values.push(subvalue);
                            dim = new Dimension(++dimid, dim, subvalue, subfield, depth, false, findex == self.dimensionsCount - 1);
                            subdimvals[subvalue] = dim;
                            dim.rowIndexes = [];
                            self.dimensionsByDepth[depth].push(dim);
                        }
                        dim.rowIndexes.push(rowIndex);
                    }
                }
            }
        }
    }
function fill ( ) { if ( self . pgrid . filteredDataSource != null && self . dimensionsCount > 0 ) { var datasource = self . pgrid . filteredDataSource ; if ( datasource != null && utils . isArray ( datasource ) && datasource . length > 0 ) { for ( var rowIndex = 0 , dataLength = datasource . length ; rowIndex < dataLength ; rowIndex ++ ) { var row = datasource [ rowIndex ] ; var dim = self . root ; for ( var findex = 0 ; findex < self . dimensionsCount ; findex ++ ) { var depth = self . dimensionsCount - findex ; var subfield = self . fields [ findex ] ; var subvalue = row [ subfield . name ] ; var subdimvals = dim . subdimvals ; if ( subdimvals [ subvalue ] !== undefined ) { dim = subdimvals [ subvalue ] ; } else { dim . values . push ( subvalue ) ; dim = new Dimension ( ++ dimid , dim , subvalue , subfield , depth , false , findex == self . dimensionsCount - 1 ) ; subdimvals [ subvalue ] = dim ; dim . rowIndexes = [ ] ; self . dimensionsByDepth [ depth ] . push ( dim ) ; } dim . rowIndexes . push ( rowIndex ) ; } } } } }
Creates all subdimensions using the supplied data
Creates all subdimensions using the supplied data