I fixed this by using the same click() function to change the scope of
the list before the serialize and change it back afterwards:

      $("#submit").click(function () {
         $('#sortable').sortable('option', 'items', 'li');
         var deploy_order = $('#sortable').sortable('serialize');
         $('#sortable').sortable('option', 'items', 'li:not(.ui-state-
disabled)');
         alert(deploy_order);
      });

I hope this helps

Regards
Rich

On Jun 11, 10:21 am, huggie <[email protected]> wrote:
> I have a sortable list that contains two disabled items, one at the
> top of the list and one at the bottom.  When I serilaize this list,
> the disabled items are excluded.
>
> I'm certain that the behaviour I'm getting is the expected behaviour,
> but I want the first and last items also included in the serialized
> list.
>
> Is there a way to handle this?
>
> The Javascript looks like this:
>
> $(function(){
>       $("#sortable").sortable({
>          axis: 'y',
>          opacity: 0.5,
>          cursor: 'pointer',
>          items: 'li:not(.ui-state-disabled)',
>       });
>       $("#submit").click(function () {
>          var deploy_order = $('#sortable').sortable('serialize');
>          alert(deploy_order);
>       });
>   });
>
> The html looks like this:
>
> <ul id="sortable">
>    <li id="order_1" class="ui-state-default ui-state-disabled ui-
> corner-all"><span class="ui-icon ui-icon-locked"></span>I'm fixed and
> don't appear in the serialization</li>
>    <li id="order_2" class="ui-state-default ui-corner-all"><span
> class="ui-icon ui-icon-arrowthick-2-n-s"></span>I'm the first item in
> the serialized list</li>
>    <li id="order_2" class="ui-state-default ui-corner-all"><span
> class="ui-icon ui-icon-arrowthick-2-n-s"></span>I'm the second item in
> the serialized list</li>
>    <li id="order_2" class="ui-state-default ui-corner-all"><span
> class="ui-icon ui-icon-arrowthick-2-n-s"></span>I'm the third item in
> the serialized list</li>
>    <li id="order_1" class="ui-state-default ui-state-disabled ui-
> corner-all"><span class="ui-icon ui-icon-locked"></span>I'm also
> fixed</li>
> </ul>
>
> Regards
> Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to