protected function _getrow($type, $value, &$attributes)
    {
        if( $row = ($this->settings['getrow'] ?? NULL) )
        {
            $rowval = $row->{$attributes['name']} ?? NULL;

            if( $type === 'textarea' || $type === 'select' )
            {
                return $value ?: $rowval;
            }

            $attributes['value'] = $value ?: $rowval;
            
            // For radio
            if( $type === 'radio' && $value == $rowval )
            {
                $attributes['checked'] = 'checked';
            }

            // For checkbox
            if( $type === 'checkbox' )
            {
                if( Json::check($rowval) )
                {
                    $rowval = json_decode($rowval, true);

                    if( in_array($value, $rowval) )
                    {
                        $attributes['checked'] = 'checked';
                    }
                }
                else
                {
                    if( ! empty($rowval) )
                    {
                        $attributes['checked'] = 'checked';
                    }            
                }
            }
        }

        return $value;
    }