SORTING QUESTION > Supercomboselect and Related Items on Many to Many relation

edited September 2012 in Modules
Hi !
I'm actually working on my first project with fuel.
First of all thanks for your work , fuel is really interesting !

I have a inclusion of a related model link on a many to many relation.
All is fine with $fields = parent::form_fields($values, $related);

But: i need to be able to sort the selected items on the right part of the Supercomboselect object
I saw we can have a 'sorting'=>true in the Field Options
isSortable,autoSort on the supercomboselect js object

but i can't figure out how to enable the feature.
... so maybe sorting is not possible on related multiple select ?

Can anyone give me some clues ?

thanks

Frédéric

Comments

  • Got it working !
    in my extension of BaseFuelController
    line 40: var sortingId = $(elem).next().attr('id');
    replaced by : var sortingId = "sorting_"+$(elem).attr('id');
  • edited 3:03PM
    You enable that in your form_fields method, as you mentioned, setting:

    $fields['attributes'] = array( 'type' => 'multi', 'mode' => 'multi', 'multiple' => true, 'sorting' => true, 'model' => array(STORE_FOLDER => array('attributes_order_model' => 'get_attributes')), 'model_params' => array($values['id']), 'description' => 'Some description' );
Sign In or Register to comment.