Create a custom dropdown

edited April 2012 in Modules
I want to create a drop-down next to search button which should load the list items according to the drop down selected,
Is it possible?

Comments

  • edited 8:31AM
    The navigation module does this and you may be able to use it as a reference. In the fuel/modules/fuel/config/fuel_modules.php file, under the navigation's module configuration, you'll see a line like the following:
    'filters' => array('group_id' => array('default' => 1, 'label' => lang('form_label_navigation_group'), 'type' => 'select')),
    There is also an associated javascript file loaded in using which you can do with modules 'js' parameter that facilitates the submitting of the search upon select (see the fuel/modules/fuel/assets/js/fuel/controller/NavigationController.js).

    With regards to the options for your dropdown, you can hard code them in as an array or use a model's list_options method to generate them.

    The next release will make the creation of options a little easier by being able to pass in a model/method to use as well as automatically submitting the form when you select a different value from the dropdown list.
Sign In or Register to comment.