`

小应用100828(Format ComboBox Items)

    博客分类:
  • JS
阅读更多
Format ComboBox Items

This tutorial will show how to create a simple combobox which displays image items in the drop down panel. You can use the formatter function on combobox to tell it how to format each of its items.

<input id="cc" type="text">

$('#cc').combobox({
    url:'combobox_data.json',
    valueField:'id',
    textField:'text',
    formatter:function(row){
        return '<img class="item-img" src="'+row.icon+'"/><div class="item-text">'+row.text+'</div>';
    }
});



As you can see above, the formatter function takes one parameter named 'row' and return the formatted item value.


http://jquery-easyui.wikidot.com/tutorial:form4
分享到:
评论

相关推荐

    C# WinForm控件美化之ImageComboBox

    这篇文章中我们重点需要实现的是(3)、(4)两项功能,下面我们来介绍具体实现的方法。 第一步,实现ImageComboBoxItem类。 要实现显示图标,当然要给每个项添加与图标相关的信息了,ImageComboBoxItem类应该包括...

    wpf写一个秒表计时器程序

    label1.Content = string.Format("Windows将在 {0} 关机", TimerClass.GetTimeString1(second)); if (second !cbo1.IsEnabled) { ShutDown(); } } int second = 0; private void Button_Click(object ...

    VB自动关机源码.rar

    If ComboBox1.Items.Item(ComboBox1.SelectedIndex) = "指定日期" Then tempStr = DateTimePicker1.Value.ToShortDateString Else tempStr = ComboBox1.SelectedItem End If tempStr &= "," & CStr(Math.Round...

    Programming Excel With Vba And .net.chm

    Table of Contents | Index Programming Excel with VBA and .NET Preface Part I: Learning VBA Chapter 1.... Section 1.1.... Section 1.2.... Section 1.3.... Section 1.4.... Section 1.5.... Section 1.6....

    BCGControlBarPro.v12.00

    Just call CBCGPRibbonComboBox::EnableCalculator method to assign a calculator to the ribbon combobox. Override a new 'OnCalculatorUserCommand' method to implement your calculator commands. Please ...

    C#全能速查宝典

    1.2.6 Round方法——将小数值舍入到指定的精度 28 1.3 流程控制语句 29 1.3.1 break语句——跳出循环 29 1.3.2 case语句——比较表达式以确定结果 30 1.3.3 continue语句——继续执行下一个循环 31 1.3.4 do…while...

    VB编程资源大全(英文源码 控件)

    &lt;END&gt;&lt;br&gt;46,FldrView.zip The Folderview ActiveX Control mimics the behaviour of the Windows Explorer Treeview showing the tree structure of the files and folders and other items in the shell's ...

    Radmin自动登录器v3.0-多国语言绿色版-Release1-20150615

    1、程序功能和使用环境介绍 2、程序操作方法介绍 3、登录信息文件RadminM.txt介绍 4、登录信息文件RadminM.txt的转换和编制 5、v3.0版新增解锁远程桌面功能 6、相关配置和多种语言支持介绍 ...

    Radmin自动登录器v3.0

    1、程序功能和使用环境介绍 2、程序操作方法介绍 3、登录信息文件RadminM.txt介绍 4、登录信息文件RadminM.txt的转换和编制 5、v3.0版新增解锁 远程桌面功能 6、相关配置和多种语言支持介绍 ...

    VB编程资源大全(英文源码 其它)

    Its contains the methods and what you need to do to move individual items or the whole contents of one listbox to another and vice-versa.&lt;END&gt;&lt;br&gt;58,supress.zip Supress Spaces in a TextBox&lt;END&gt;&lt;br...

Global site tag (gtag.js) - Google Analytics