Why does Jquery UI Sortable toArray
method give back array like this (in Firebug):
ordering[] = 1
ordering[] = 2
ordering[] = 3
And when i use custom function to ignore hidden items, it gives back a string, like this:
ordering = 1,2,3
I've checked plenty of times, it seems there's no difference between original Sortable toArray
function code:
toArray: function(o) {
var items = this._getItemsAsjQuery(o && o.connected),
ret = [];
o = o || {};
items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
return ret;
}
and my custom function:
function(){ // Do not pass hidden clones
var items = [];
$('#fp_parameters_list').children().each(function(){
if ($(this).is(':visible')) items.push($(this).attr('data-parameter-id'));
});
return items;
}
except that my doesn't counter hidden fields.
Thanks, if someone can help.