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

Custom editable #1

Closed
levanlau opened this issue Aug 4, 2014 · 1 comment
Closed

Custom editable #1

levanlau opened this issue Aug 4, 2014 · 1 comment
Labels

Comments

@levanlau
Copy link

levanlau commented Aug 4, 2014

Hi,
I have use Editable widget in gridview successfully:
'value' => function($model,$attribute,$index,$widget){
return kartik\editable\Editable::widget([
'name' => 'quantity-' . $index,
'value'=> $model['quantity'],
'type'=>'default',
'size'=>'md',
'placement'=>'top',
'containerOptions'=>['style'=>'min-width:200px;width:200px;text-align:center;'],
'contentOptions'=>['style'=>'width:200px;text-align:center;'],
'inputType'=>kartik\editable\Editable::INPUT_SPIN,
'editableValueOptions'=>['class'=>'text-success h2'],
]);
},
I have tried a lot of attributes but i have not known how to set some attributes for Popover and Spin such as:

  • Can not align text center in Spin itsself
  • Set width for Spin is ok, but for Popover is not.(I'd like custom 'size'=>'md')
  • Do not know how to hidden Reset button.
  • Do not know how to use client events and submit ajax for Spin widget
  • How to add button to footer
    May you give me some suggestions ?Thanks.
@kartik-v
Copy link
Owner

kartik-v commented Aug 4, 2014

Hope you have gone through the docs... Else, read the Editable Widget documentation in detail for all possible settings.

  • You can use options property to supply the widget configuration options (in your case SPIN). You can pass pluginOptions within this array to set your client options.
  • You can use showButtons property to hide or show default buttons.
  • You can use resetButton property to control HTML options for reset button. Add a class hide or set its style to display:none for example to hide it.
  • You can customize the footer property to add your Html::a markup to add your own custom buttons. Just concatenate the variable {buttons} to show default buttons along with this.

Again read the docs and try all settings.

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

No branches or pull requests

2 participants