The following example demonstrates how to add a single item into the imMultiLineList plugin. Use the addItem method to add an item. The item added can be one of the following:
{"id": "1", "address": "111 Whatever Street, This City, MD 22222"}
111 Whatever Street, This City, MD 22222~5
$(document).ready( function() {
var addressList = $("#listCntnr").imMultiLineList({
option_map: {"optionValue": "id", "optionText": "address"},
item_class: "multiListItem",
item_hover_class: "multiListItemHover",
item_select_class: 'multiListItemSelect'
});
addressList.addItems('assets/js/jquery/immultilinelist/address.php');
$('#theButton').click(function() {
addressList.addItem($('#theText').val());
});
});
View the source for this page to see how to setup the plugin. For documentation about the imMultiLineList plugin, view the blog post.