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

Calendar form field on('change') event handler not working #521

Closed
skondakov opened this issue Jul 6, 2018 · 6 comments
Closed

Calendar form field on('change') event handler not working #521

skondakov opened this issue Jul 6, 2018 · 6 comments
Assignees
Labels

Comments

@skondakov
Copy link
Contributor

When I set an on change event handler on a Calendar form field, even a simple alert, it is not being executed.

@ibelar
Copy link
Contributor

ibelar commented Jul 9, 2018

@skondakov - How do you setup your onChange handler?

This is working fine for me and I can properly see output in console:

$f = $app->add('Form');
$f->setModel($m);

$d = $f->fields['date'];
$d->options['onChange'] = new \atk4\ui\jsExpression('function(date, text, mode){
            console.log(date, text, mode);
            }');

I simply pass the onChange option to the date field passing a jsExpression to it.

@romaninsh
Copy link
Member

romaninsh commented Jul 9, 2018

I think he uses jsInput()->on('change', ... ) , which works with regular inputs, but is not being triggered by semantic ui. In which case it probably is a fomantic's issue.

If that's the case, perhaps Fomantic-UI can do it (see also #523)

@ibelar
Copy link
Contributor

ibelar commented Jul 9, 2018

Seems like fomantic is not using any calendar input yet...
fomantic/Fomantic-UI#8

And in our case, we are using mdehoog calendar input: https://github.com/mdehoog/Semantic-UI-Calendar

Mdehoog input use it's own 'change' event handler internally for which you can hook up using the 'onChange' option of the calendar input.

@romaninsh
Copy link
Member

could be solved by #523

@DarkSide666 DarkSide666 self-assigned this Aug 25, 2018
DarkSide666 added a commit that referenced this issue Aug 25, 2018
* works around Calendar field issue (#521)
* it's more intuitive and makes developers life easier :)
* includes demo
* includes documentation
@DarkSide666
Copy link
Member

Switched to Fomantic. Need to test if this is now ok and if it is - close ticket.

@ibelar
Copy link
Contributor

ibelar commented Oct 8, 2018

Fix in #547

@ibelar ibelar closed this as completed Oct 8, 2018
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

4 participants