How to use jq_sortable_element

20 views
Skip to first unread message

Petar Mitchev

unread,
May 12, 2010, 11:07:39 AM5/12/10
to sfJqueryReloadedPlugin
Hi guys,
I'm trying to implement jq_sortable_element instead of the old
sortable_element, but I can't make it to work. I'm not really using
jQuery often, so excuse me for my incompetence.

Here is my code:

<tbody id="order">
<?php foreach ($pager->getResults() as $i => $Banner): $odd =
fmod(++$i, 2) ? 'odd' : 'even' ?>
<tr class="sf_admin_row <?php echo $odd ?> row">
<?php include_partial('banner/list_td_batch_actions',
array('Banner' => $Banner, 'helper' => $helper)) ?>
<?php include_partial('banner/list_td_tabular',
array('Banner' => $Banner)) ?>
<?php include_partial('banner/list_td_actions',
array('Banner' => $Banner, 'helper' => $helper)) ?>
</tr>
<?php endforeach; ?>
</tbody>

<div id="feedback"></div>
<?php echo jq_sortable_element('order', array(
'url' => 'banner/ajaxSort',
'update' => 'feedback',
'only' => 'rows',
'tag' => 'tr',
'loading' => "Element.show('indicator')",
'complete' => "Element.hide('indicator')",
'success' => jq_visual_effect('highlight', 'feedback'),
)) ?>

Can you tell me how to implement the method correctly?

Tom Boutell

unread,
May 12, 2010, 11:10:18 AM5/12/10
to sfjqueryrel...@googlegroups.com
You have no ids on your rows, that can't possibly work... see
http://www.symfony-project.org/book/1_0/11-Ajax-Integration for
information about how it's supposed to work (the jQuery version
follows the same pattern).
--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

Tom Boutell

unread,
May 12, 2010, 11:10:41 AM5/12/10
to sfjqueryrel...@googlegroups.com
Also I'm not sure whether you can make table rows draggable or not,
honestly. If you get no draggable behavior consider using li's
instead.

On Wed, May 12, 2010 at 11:07 AM, Petar Mitchev <ime...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages