public function setColumnRatios($ratios)
    {
        // Filter all values > 0
        $r = array_filter($ratios, function ($val) {
            return $val > 0;
        });

        // Check if all values are valid
        if (count($r) != count($ratios)) {
            return $this;
        }

        // Map all values to percent
        $r = array_map(function ($val) {
            return intval($val * 100);
        }, $r);

        // Check if sums up to 100
        $total = array_sum($r);
        if ($total != 100) {
            throw new InvalidArgumentException('The column ratios dont sum up to 100.');
        }

        // Correct ratio for checkable grid lists
        $totalRatio = (!$this->checkable ? 1.0 : 0.92);
        $r = array_map(function ($val) use ($totalRatio) {
            return $val * $totalRatio;
        }, $r);

        // Set column ratios data to element
        $this->columnRatios = $r;
        $this->gridList->data('column-ratios', $this->columnRatios);

        return $this;
    }
public function setColumnRatios($ratios)
    {
        // Filter all values > 0
        $r = array_filter($ratios, function ($val) {
            return $val > 0;
        });

        // Check if all values are valid
        if (count($r) != count($ratios)) {
            return $this;
        }

        // Map all values to percent
        $r = array_map(function ($val) {
            return intval($val * 100);
        }, $r);

        // Check if sums up to 100
        $total = array_sum($r);
        if ($total != 100) {
            throw new InvalidArgumentException('The column ratios dont sum up to 100.');
        }

        // Correct ratio for checkable grid lists
        $totalRatio = (!$this->checkable ? 1.0 : 0.92);
        $r = array_map(function ($val) use ($totalRatio) {
            return $val * $totalRatio;
        }, $r);

        // Set column ratios data to element
        $this->columnRatios = $r;
        $this->gridList->data('column-ratios', $this->columnRatios);

        return $this;
    }
public function setColumnRatios ( $ ratios ) { // Filter all values > 0 $ r = array_filter ( $ ratios , function ( $ val ) { return $ val > 0 ; } ) ; // Check if all values are valid if ( count ( $ r ) != count ( $ ratios ) ) { return $ this ; } // Map all values to percent $ r = array_map ( function ( $ val ) { return intval ( $ val * 100 ) ; } , $ r ) ; // Check if sums up to 100 $ total = array_sum ( $ r ) ; if ( $ total != 100 ) { throw new InvalidArgumentException ( 'The column ratios dont sum up to 100.' ) ; } // Correct ratio for checkable grid lists $ totalRatio = ( ! $ this -> checkable ? 1.0 : 0.92 ) ; $ r = array_map ( function ( $ val ) use ( $ totalRatio ) { return $ val * $ totalRatio ; } , $ r ) ; // Set column ratios data to element $ this -> columnRatios = $ r ; $ this -> gridList -> data ( 'column-ratios' , $ this -> columnRatios ) ; return $ this ; }
Sets the ratios of the columns widths.

@param array $ratios The columns width ratios. Must contain numeric values between 0 and 1 (excluding) or else
the requested ratios will be ignored.

@return $this
@throws InvalidArgumentException
Sets the ratios of the columns widths .