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

Input Widget form Editable #20

Closed
bigbear1989 opened this issue Nov 21, 2014 · 7 comments
Closed

Input Widget form Editable #20

bigbear1989 opened this issue Nov 21, 2014 · 7 comments
Labels

Comments

@bigbear1989
Copy link

Hi!
I cant initializate a submit button from form when i choose 'inputType' is 'Editable::<widget_name>'.
Submit button is shown, but its hasnt event on click, change etc
My example (from base class EditableColumn):
" 'name'=>'spinWidget',

                    'inputType' => Editable::INPUT_SPIN,
                    'options' => [
                        'options'=> ['id'=>'spin-'.$index],
                        'pluginOptions' => ['step' => 0.1, 'decimals' => 1, 'min'=>0.8, 'max'=>1.2]
                    ],"

When I choosin a simple textinput, form is workin normally.
Thankes, have a good day

@kartik-v kartik-v changed the title Input Widget form by Edaitable module Input Widget form Editable Nov 21, 2014
@kartik-v
Copy link
Owner

I am not able to understand the issue completely.

The Editable widget does indeed work with other widgets beyond text inputs like INPUT_SPIN (TouchSpin) which you have used above.

EDIT: I think you are using this with the editable column in grid view. Will need to check and update.

@kartik-v
Copy link
Owner

Enhancements done to the extension so you can use all inputs (text, dropdown, checkbox etc.). In addition you can use all widgets as well (e.g. DatePicker, StarRating, RangeInput etc.). This works with both Editable and EditableColumn.

Upgrade to release v1.6.0.

@kartik-v
Copy link
Owner

If you are using TouchSpin widget ensure you are passing ONLY numeric values to the input.
For example the attribute should be converted to number always:

// Model
public $amount;
//...
$this->amount = is_numeric($this->amount) ? $this->amount : 0;

@bigbear1989
Copy link
Author

Hi,
You right about using Editable widget in EditableColunm.Also Im passing a numeric values as from example in subj
'['step' => 0.1, 'decimals' => 1, 'min'=>0.8, 'max'=>1.2]'

@kartik-v
Copy link
Owner

By numeric data I mean the data saved in your database could be null or having some spaces/string... you need to implicitly check for these and convert to a numeric data always ... for TouchSpin widget to work properly.

Secondly I think the bootstrap-touchspin plugin by DEFAULT only supports values between 0 to 100 (unless you have set otherwise). You may get errors because of these as well.

If you have set min and max rightly, you need to check the step correctly. It seems the bootstrap-touchspin has problems with step less than 1 as decimals. Would first suggest you use step as 1 and then try if it works. Basically test the touchspin plugin settings in isolation before using it in the Editable or EditableColumn.

@kartik-v
Copy link
Owner

I am working on updating this release. Please hold on.

@kartik-v kartik-v reopened this Nov 22, 2014
kartik-v added a commit that referenced this issue Nov 22, 2014
@kartik-v
Copy link
Owner

Upgrade to latest release. You can check the grid demo of usage of two editable columns including one with TouchSpin widget.

Also importantly refer this web tip on setting up the editable column for manipulating records.

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