Access an array’s Indice value

Asked

Viewed 45 times

0

How do I get the value of the array’s input in each interaction, without having to place the Permissionusuariofilter.Userpermissionid[0] dynamical and non-static Dice. console I need the class to stay that way classe

  • 1

    Wasn’t you supposed to be doing permissionSalve.PermissionId = item; ?

  • Exactly, but now he’s just saving the last item on the list at the bank.

  • I didn’t see all the code, but I don’t understand why Deserialize, if you pass the javascript parameter correctly no need to say, the method should accept List<long> as a parameter

1 answer

0


In the method .each( it is possible to pick up the position of the array index and value it contains value.

.each( function (index,value)

In the first interaction index equal 0 and value equal {UserPermissionId : 7}

So you can give one value.UserPermissionId to get the value 7

I hope I helped, good luck.

  • not because they are two arrays, one Userpermission and the other Permissionusuario, I want to buy the identical values of the two and mark "checked",true for the values ==, each does not accept two arrays as parameter.

  • Okay, use the other .each() to go through the filtered list, so you can get the result you want.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.