jquery.repeater
jquery.repeater copied to clipboard
isFirstItemUndeletable doesn't work if you use setList()
To start the repeater with some data, using the setList() function, the first element on the repeater is showing the delete button even is isFirstItemUndeletable is set to true.
same with me, how to make it work?
I couldn't.
I dropped the idea of using a setList() and create my own logic by triggering the click event on add
and remove
buttons.
Same problem here! Any solution?
I just cheated a bit and used some CSS. In my case I wanted to remove the delete button from fields that are required in my form, so I added a .required-item
class to the parent element of the button and did .required-item:first-of-type [data-repeater-delete] { display: none; }
I ran into the same problem, I made a file with a quick fix, the only thing you have to do is include it before the jquery,repeater library https://gist.github.com/lcabre/d2ca0389abee4c75f4822cd6ce93433c
I solved it using css - [data-repeater-item]:first-child [data-repeater-delete] { display: none; }
Hello I have another solution data-repeater-list = description
- Set name to delete button
<button class="btn btn-icon btn-danger rounded-circle" type="button" data-repeater-delete id="dButton" name="dButton" >
<i class="bx bx-x"></i>
</button>
- Create css using name button
button[name="description[0][dButton]"] {
display: none;
}
I solved it using css -
[data-repeater-item]:first-child [data-repeater-delete] { display: none; }
best and simple solution