jQWidgets Forums

jQuery UI Widgets Forums Lists ListBox Search in listbox

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Search in listbox #4963

    Neelam
    Member

    Hello,

    I want to search content in list box by typing in a text field. I am using this function but it doesn’t return anything.

    $(“#jqxListBox”).jqxListBox({searchMode: ‘contains’ });

    Search in listbox #4967

    Neelam
    Member

    Hello,

    is anybody there to help me out?

    Search in listbox #5052

    Peter Stoev
    Keymaster

    Hi Neelam,

    The jqxListBox’s ‘searchMode’ is a property, not a function. To get all items that match to a search criteria, you should you the ‘findItems’ method.

    For example:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="keywords" content="jQuery DropDownList, List, ListBox, Popup List, jqxDropDownList, jqxListBox, List Widget, ListBox Widget, DropDownList Widget" />
    <meta name="description" content="The jqxListBox represents a widget that contains a list of selectable items."/>
    <title id='Description'>The jqxListBox represents a widget that contains a list of selectable
    items. </title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    </head>
    <body>
    <div id='content'>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getTheme();
    var source = [
    "Affogato",
    "Americano",
    "Bicerin",
    "Breve",
    "Café Bombón",
    "Café au lait",
    "Caffé Corretto",
    "Café Crema",
    "Caffé Latte",
    "Caffé macchiato",
    "Café mélange",
    "Coffee milk",
    "Cafe mocha",
    "Cappuccino",
    "Carajillo",
    "Cortado",
    "Cuban espresso",
    "Espresso",
    "Eiskaffee",
    "The Flat White",
    "Frappuccino",
    "Galao",
    "Greek frappé coffee",
    "Iced Coffee",
    "Indian filter coffee",
    "Instant coffee",
    "Irish coffee",
    "Liqueur coffee"
    ];
    // Create a jqxListBox
    $("#jqxWidget").jqxListBox({ source: source, width: 200, height: 250, theme: theme });
    var foundItems = $("#jqxWidget").jqxListBox('findItems', 'Cap');
    });
    </script>
    <div id='jqxWidget'>
    </div>
    </div>
    </body>
    </html>

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.