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

setList is not a function #69

Open
KumaVolt opened this issue Sep 28, 2017 · 0 comments
Open

setList is not a function #69

KumaVolt opened this issue Sep 28, 2017 · 0 comments

Comments

@KumaVolt
Copy link

The repeater initializes. I can repeat my form, but when I use the function setList() like this:

$(document).ready(function () { $('.repeater').repeater({ // (Optional) // start with an empty list of repeaters. Set your first (and only) // "data-repeater-item" with style="display:none;" and pass the // following configuration flag initEmpty: true, // (Optional) // "defaultValues" sets the values of added items. The keys of // defaultValues refer to the value of the input's name attribute. // If a default value is not specified for an input, then it will // have its value cleared. defaultValues: { 'text-input': 'foo' }, // (Optional) // "show" is called just after an item is added. The item is hidden // at this point. If a show callback is not given the item will // have $(this).show() called on it. show: function () { $(this).slideDown(); }, // (Optional) // "hide" is called when a user clicks on a data-repeater-delete // element. The item is still visible. "hide" is passed a function // as its first argument which will properly remove the item. // "hide" allows for a confirmation step, to send a delete request // to the server, etc. If a hide callback is not given the item // will be deleted. hide: function (deleteElement) { if(confirm('Are you sure you want to delete this element?')) { $(this).slideUp(deleteElement); } }, // (Optional) // You can use this if you need to manually re-index the list // for example if you are using a drag and drop library to reorder // list items. ready: function (setIndexes) { $dragAndDrop.on('drop', setIndexes); }, // (Optional) // Removes the delete button from the first list item, // defaults to false. isFirstItemUndeletable: true }).setList([{'street_name': 'Lorem ipsum'}]); });

I get an error saying setList is not a function in the console log.
I'm currently using jquery.repeater version 1.2.1 with Laravel.mix

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

No branches or pull requests

1 participant