[jQuery] Sortable help

2010-01-13 Thread Ryan Gartin
This is sort of in reference to this (http://groups.google.com/group/
jquery-en/browse_thread/thread/8219bd3a3f106497) post. Also to note, I
am completely new to jQuery, but it's awesome!!!

Ok, why does the following work in jquery 1.2.6 (UI: jquery-ui-
personalized-1.6rc2.min.js) but not in 1.3.2? What do I need to edit/
redo to perform the same task.
(Working version but with 1.2.6: 
http://james.padolsey.com/demo/tut-inettuts-with-cookies/)

makeSortable : function () {
var iNettuts = this,
$ = this.jQuery,
settings = this.settings,
$sortableItems = (function () {
var notSortable = '';
$(settings.widgetSelector,$(settings.columns)).each
(function (i) {
if (!iNettuts.getWidgetSettings(this.id).movable)
if(!this.id) {
this.id = 'widget-no-id-' + i;
}
notSortable += '#' + this.id + ',';
}
});
return $('> li:not(' + notSortable + ')',
settings.columns);
})();

$sortableItems.find(settings.handleSelector).css({
cursor: 'move'
}).mousedown(function (e) {
$sortableItems.css({width:''});
$(this).parent().css({
width: $(this).parent().width() + 'px'
});
}).mouseup(function () {
if(!$(this).parent().hasClass('dragging')) {
$(this).parent().css({width:''});
} else {
$(settings.columns).sortable('disable');
}
});

$(settings.columns).sortable({
items: $sortableItems,
connectWith: $(settings.columns),
handle: settings.handleSelector,
placeholder: 'widget-placeholder',
forcePlaceholderSize: true,
revert: 300,
delay: 100,
opacity: 0.8,
containment: 'document',
start: function (e,ui) {
$(ui.helper).addClass('dragging');
},
stop: function (e,ui) {
$(ui.item).css({width:''}).removeClass('dragging');
$(settings.columns).sortable('enable');
/* Save prefs to cookie: */
iNettuts.savePreferences();
}
});
},


[jQuery] Sortable Help

2009-11-10 Thread Dave Maharaj :: WidePixels.com
I am trying to send the data in a numbered array but i end up with
set[]=56454&set[]=54546522
 
when i need set[0]=56454&set[1]=54546522
 
$(document).ready(function() {
 $("#sortable").sortable({
 
  placeholder: 'ui-state-highlight',
  update: function() {$.post('/order/.php',{data:
$("#sortable").sortable('toArray')});}
 });
 
 $("#sortable").disableSelection();
 
});
 
Can someone seewhere I am going wrong here?
 
Thanks
 
Dave


[jQuery] Sortable Help

2009-10-14 Thread Dave Maharaj :: WidePixels.com

I am sorting but the data being sent is in wrong format.
Response headers:
 
 
data =
entry[]=cf43c5caa5e&entry[]=1cb5758d6aa&entry[]=ee713a3034a&entry[]=d32cea34
83f

key =   entry_0[]
 

but it should be
entry[0]=cf43c5caa5e&entry[1]=1cb5758d6aa&entry[2]=ee713a3034a&entry[3]=d32c
ea3483f
 
script looks like
 
$("#sortable").sortable({
  update: function() {
   $.post('/manage/entries/order/', {
   data: $("#sortable").sortable("serialize"),
   key: 'entry_0[]'
  });
  }
 });

Can someone point out where I went wrong?

Thanks
 
Dave