]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Added custom rendering for custom data demo.
authorScott González <scott.gonzalez@gmail.com>
Wed, 21 Apr 2010 13:57:35 +0000 (09:57 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 21 Apr 2010 13:57:35 +0000 (09:57 -0400)
demos/autocomplete/custom-data.html

index 57598fa8c90a9e2420350437d0aa9f4ec7b9d45c..139b41d9988270b409403a12dde8306551ae107c 100644 (file)
                                
                                return false;
                        }
-               });
+               })
+               .data( "autocomplete" )._renderItem = function( ul, item ) {
+                       return $( "<li></li>" )
+                               .data( "item.autocomplete", item )
+                               .append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
+                               .appendTo( ul );
+               };
        });
        </script>
 </head>