You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: 3.2
Problem: Removing a specific item (eg. the second) from a $.Model.List instance removes always the first item.
Example code:
var list = new $.Model.List([{tag: 'bla1', rating: 1},{tag: 'bla2', rating: 2},{tag: 'bla3', rating: 3}]);
list.remove(list.match('tag', 'bla2'))
The list has now the following content:
[Object { tag= "bla2", rating=2}, Object { tag="bla3", rating=3}]
Quick Solution:
There is something wrong with idetification of the item which has to be removed. The slice operation extracts always the first element instead of the specified one. The following code solves the problem. Replace (at ~ line 512)
if ( inst[idName] == id ) {
with:
if ( jQuery.toJSON(inst) == jQuery.toJSON(args[a]) ) {
I would appreciate if you could have a look at this issue and solve it for the next release.
Thanks and kind regards
Oli
The text was updated successfully, but these errors were encountered:
Version: 3.2
Problem: Removing a specific item (eg. the second) from a $.Model.List instance removes always the first item.
Example code:
var list = new $.Model.List([{tag: 'bla1', rating: 1},{tag: 'bla2', rating: 2},{tag: 'bla3', rating: 3}]);
list.remove(list.match('tag', 'bla2'))
The list has now the following content:
[Object { tag= "bla2", rating=2}, Object { tag="bla3", rating=3}]
Quick Solution:
There is something wrong with idetification of the item which has to be removed. The slice operation extracts always the first element instead of the specified one. The following code solves the problem. Replace (at ~ line 512)
if ( inst[idName] == id ) {
with:
if ( jQuery.toJSON(inst) == jQuery.toJSON(args[a]) ) {
I would appreciate if you could have a look at this issue and solve it for the next release.
Thanks and kind regards
Oli
The text was updated successfully, but these errors were encountered: