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

jQuery issues #42

Closed
sandevgo opened this issue Sep 30, 2015 · 3 comments
Closed

jQuery issues #42

sandevgo opened this issue Sep 30, 2015 · 3 comments

Comments

@sandevgo
Copy link

I've spent for couple hours trying to get extension work, but could not.

Firstly, you can't use data() like this:

            $wrapper.data('multipleInput', {
                settings: settings,
                currentIndex: 0,
                attributeDefaults: {}
            });

It just doesn't work. The explonation is here: http://stackoverflow.com/questions/6827810/unable-to-set-data-attribute-using-jquery-data-api

Next, where did you get such events?

      $(document).on('click.multipleInput', ....);

I was trying to fix it, but it was like a snowball, and all that I got was just a single text input without able to add fields.

@unclead
Copy link
Owner

unclead commented Oct 1, 2015

I dont want to update the DOM via data method, i am using it like a storage. I think if data method didnt work it would not have been used in yiiActiveForm.js.
Look at: https://github.com/yiisoft/yii2/blob/master/framework/assets/yii.activeForm.js#L200

$(document).on('click.multipleInput', ....);

It is just namespace for event: https://api.jquery.com/event.namespace/
I cant understand what is the problem with it?

@unclead
Copy link
Owner

unclead commented Oct 1, 2015

what version of jquery are you using?
I think problem relates with your environment thats why i need more information

@sandevgo
Copy link
Author

sandevgo commented Oct 6, 2015

I'm sorry, I have solved this issue. It was my miss, connected with resolving asset bundles. Now, all seems ok, thank You.

@sandevgo sandevgo closed this as completed Oct 6, 2015
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

2 participants