jquery.repeater icon indicating copy to clipboard operation
jquery.repeater copied to clipboard

.setList not setting date input nor a number input

Open MrJoshFisher opened this issue 1 year ago • 9 comments

Hello all,,

I'm having an issue with the setList function whereby its not setting the values for a number field nor a date field,

<input type="number" name="pet_treat" value="" class="form-control" />
<input type="date" name="pet_birthday" value="" class="form-control" />

setList(
  [
    {
      "pet_treat": "2",
      "pet_birthday": "18-05-2020",
    }
   ]
)

end up getting the error:

jquery.min.js?ver=3.6.1:2 Uncaught TypeError: Cannot read properties of undefined (reading 'set')

it works if I change the inputs to type text, select or checkbox which work fine, just for some reason date and number fields cause the error

Any advice?

Cheer

MrJoshFisher avatar Apr 19 '23 12:04 MrJoshFisher

@MrJoshFisher I am facing a similar problem, did you find a solution?

Edit: I am facing the exact same problem

adeel94mirza avatar May 08 '23 14:05 adeel94mirza

#112 For future developers who run into this problem. I did not set the type property on the input which caused the issue.

adeel94mirza avatar May 08 '23 14:05 adeel94mirza

@MrJoshFisher I am facing a similar problem, did you find a solution?

Edit: I am facing the exact same problem

No I didn't, I ended up using a different library entirely which was the basic jquery repeater library.

MrJoshFisher avatar May 09 '23 17:05 MrJoshFisher

Now I'm currently facing the same problem, is there already any solution for this?

bagus-dev avatar Jul 17 '23 02:07 bagus-dev

Now I'm currently facing the same problem, is there already any solution for this?

Afraid not I ended up using a different library

MrJoshFisher avatar Jul 19 '23 18:07 MrJoshFisher

Screenshot 2023-07-20 at 3 06 55 AM

I have made a simple change and that works

nicknicknickcheng avatar Jul 19 '23 19:07 nicknicknickcheng

Actually input type date and number is missing in the bundle file, so we can solve the issue by adding simple codes in 3 places.

nu = function (a) { var b = {}, c = x(a, b); return ( (c.getType = function () { return "number"; }), c ); }, dt= function (a) { var b = {}, c = x(a, b); return ( (c.getType = function () { return "date"; }), c ); }, in variable declation section

        `number:nu,
         date:dt` in function A  variable assignment

: f.is('input[type="number"]') ? i("number", f) : f.is('input[type="date"]') ? i("date", f) and i("number", 'input[type="number"]'), i("date", 'input[type="date"]'), in return of function A

its-sangam avatar Dec 13 '23 11:12 its-sangam

Screenshot 2023-07-20 at 3 06 55 AM

I have made a simple change and that works

This fixed the issue for me. Thank you.

thebradleysanders avatar Jan 26 '24 17:01 thebradleysanders