Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TbSelect2 allow enable/disable or readonly #305

Closed
PrplHaz4 opened this issue Jan 31, 2013 · 5 comments
Closed

TbSelect2 allow enable/disable or readonly #305

PrplHaz4 opened this issue Jan 31, 2013 · 5 comments

Comments

@PrplHaz4
Copy link
Contributor

Currently there is no parameter to enable/disable the TbSelect2 widget. It seems like the most versatile solution would be to allow setting htmlOptions of the container div.

Setting a class of "select2-container-disabled" will initialize the control in a disabled state.

@porcelanosa
Copy link

#299 this maybe solve your problem

@hijarian
Copy link
Contributor

Indeed, when the #299 will be fixed, then you will be able to set the needed class to the container div and this issue will be resolved.

@digitalcrab
Copy link
Contributor

Hello guys @PrplHaz4 @porcelanosa
Live example: http://yii-demo.yukki.name/bootstrap/issue305
Code:

        <?php $this->widget('bootstrap.widgets.TbSelect2', array(
            'htmlOptions' => array(
                'id' => 'select_readonly',
            ),
            'readonly' => true,
            'name' => 'select_readonly',
            'data' => $data,
        )); ?>
        <?php $this->widget('bootstrap.widgets.TbSelect2', array(
            'htmlOptions' => array(
                'id' => 'select_disabled',
            ),
            'disabled' => true,
            'name' => 'select_disabled',
            'data' => $data,
        )); ?>

It is done in current brunch and will be included to the next release.
Thank you

@PrplHaz4
Copy link
Contributor Author

thanks @fromYukki! any idea if this fix works in tag mode as well?

@digitalcrab
Copy link
Contributor

@PrplHaz4 i think yes ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants