For a recent project we needed to show list of users with some basic information and with multiple select options, just like facebook friends selector for selecting friends, groups, projects etc…
This is generally a requirement in most of the social networking projects, with minor changes here and there.
So I decided to build a plug-in with some easy configuration options, which should work independent of the type of object to be shown in the list.
It’s a nice FB like user interface to select multiple elements. We can configure it easily by some parameters as described below.
The features I’d like to highlight are:- FB like user interface.
- Word filter.
- Templates.
- Auto complete.
- Effortless integration and easy to customize.
For more information on setup and download click here
You just need to call the helper with required parameters, on the page where you want the list to be displayed <%= awesome_selector :objects => @users, :field_names => ["name","email"], :form_post_url => users_path, :template => "template_1", :auto_complete_field_name => "name", :image_url => "avatar_photo_url(:thumb)", :max_selection_limit => [5, 'Sorry, you can not select more users.'] %>Currently there are two templates available ‘template_1′ and ‘template_2′. An example of the generated list is as follows:
template_1 template_2After submitting the form, selected object ids are available as params[:selected_element_ids] separated by comma.
Thanks to the following for their kind contribution to the JS libraries used in this plugin.
- Autocomplete by Tomas Kirda
- jquery-filter-plugin by Kent Safranski
[Via http://sappsdreams.wordpress.com]
No comments:
Post a Comment