开发者

jquery picklist plugin supporting rich content - is there one?

开发者 https://www.devze.com 2023-04-13 01:27 出处:网络
I\'m trying to find a picklist plugin that can support the dis开发者_运维问答play of images, which rules out select and option tags (and hence this plugin:

I'm trying to find a picklist plugin that can support the dis开发者_运维问答play of images, which rules out select and option tags (and hence this plugin: http://gsgd.co.uk/sandbox/jquery/picklists/). Does anyone know of one? I've looked high and low with no success.

There was one "Dodo's picklist" but the link is dead.

Thanks.


Another one to check out is jquery-picklist. It creates a picklist from a regular HTML multiple option <select>, like this:

Example HTML:

<select id="foobar" name="foobar" multiple="multiple">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Foobar</option>
</select>

<div id="someElement">
    <div><img src="foobar.png" /></div>
    <div>A rich item!</div>
</div>

Example JS:

$("#foobar").pickList(
{
    items:
    [
        {
            value: 4,                   // Sent in POST (if item has been selected)
            label: "A Rich Item"        // Used for sorting, not displayed for rich items
            selected: true,             // true puts item in "selected" list, false puts item in "available" list
            element: $("#someElement")  // The DOM element to be used as the item
        }
    ]
});

As shown in the example, an array of object literals can be passed in during initialization. These object literals define the items to be added to the list during creation.

Rich content items can be added by specifying the element property in the object literal. Any DOM element (preexisting or created on-the-fly) can be used. Details on rich content items is documented here.

Disclaimer: I'm the author of the plugin. I encourage you to try them all out for yourself and decide what works for you.


Did you try http://code.google.com/p/jquery-picklist/ ?

I just had a look at the demo (which also contains the documentation), and it looks like what you are asking for.


PrimeUI's PickList supports customizable content;

http://www.primefaces.org/primeui/picklist.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号