379a1db5992bcdc0741f16961d45cf24e10600da.svn-base 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Custom Format in ComboBox - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Custom Format in ComboBox</h2>
  14. <p>This sample shows how to custom the format of list item.</p>
  15. <div style="margin:20px 0"></div>
  16. <input class="easyui-combobox" name="language" data-options="
  17. url: 'combobox_data1.json',
  18. method: 'get',
  19. valueField: 'id',
  20. textField: 'text',
  21. panelWidth: 350,
  22. panelHeight: 'auto',
  23. formatter: formatItem
  24. ">
  25. <script type="text/javascript">
  26. function formatItem(row){
  27. var s = '<span style="font-weight:bold">' + row.text + '</span><br/>' +
  28. '<span style="color:#888">' + row.desc + '</span>';
  29. return s;
  30. }
  31. </script>
  32. </body>
  33. </html>