Swaplist [JQuery Plugin]

A few days ago I developed Jquery plugin, it was very useful to use it in client side, the plugin generate UI for two lists and give you ability to swap items between them
Plugin have methods to initialize it with data or get data from it, data is represented in plugin with JSON format


Plugin methods:
1- SetListData(Data):

 the input represented in json format as a list of items for first list, like { items: [{ key: 'item1', value: '1' }, { key: 'item2', value: '2'}] };


2- GetSelectedItems():

 returns second list items in json format, like { items: [{ key: 'item1', value: '1' }]};


3- SetListClass(CssClassName):

 takes class name as input, this method concerned about setting css for lists

How to use?
1- add div element to your form,

2- use ready function to assign plug-in into div class "swaplist" or for your defined class in your div element, $().ready(function() {
var data = { items: [{ key: 'item1', value: '1' }, { key: 'item2', value: '2'}] };
$(".swaplist").SetListData(data);
$(".swaplist").SetListClass("listCss");

});

To download it use the following link http://plugins.jquery.com/project/SwapList

2 Comments

Comments have been disabled for this content.