EasyUI 学习笔记(一)
来源:互联网 发布:搞笑淘宝店名 编辑:程序博客网 时间:2024/06/05 22:59
EasyUI是一个强大的,优雅的学习框架
其中,Combo Box (组合框)控件很简单,可以节省空间。从用户角度来看,这个控件是由一个文本输入控件和一个下拉菜单组成的。用户可以从一个预先定义的列表里选择一个选项,同时也可以直接在文本框里面输入文本。
1、定义控件对应变量
假定已经创建了一个Dialog,并且从控件工具箱将 Combo Box 控件拖放到上面。打开 Class Wizard,添加控件对应变量,
如:CComboBox m_cbExamble;
在后面的代码中会不断使用这个变量。
2、向控件添加 Items
1) 在Combo Box控件属性的Data标签里面添加,一行表示Combo Box下拉列表中的一行。换行用ctrl+回车。
2)利用函数 AddString()向Combo Box 控件添加 Items,如:
m_cbExample.AddString(“StringData1”);
m_cbExample.AddString(“StringData2”);
m_cbExample.AddString(“StringData3”);
3)也可以调用函数 InsertString()将 Item插入指定位置 nIndex,如:
m_cbExample.InsertString( nIndex, “StringData” );
3、从控件得到选定的Item
假设在控件列表中已经选定某项,现在要得到被选定项的内容,首先要得到该项的位置,然后得到对应位置的内容。这里会用到两个函数,如:
int nIndex = m_cbExample.GetCurSel();
CString strCBText;
m_cbExample.GetLBText( nIndex, strCBText);
这样,得到的内容就保存在 strCBText中。
若要选取当前内容,可调用函数GetWindowText(strCBText)。
function initBaseInfo() {$('#customer0').validatebox({required : true});$('#customerTel0').validatebox({required : true});if (null != '${model.customer}' && '' != '${model.customer}' && 'undefined' != '${model.customer}') { $('#customer0').val('${model.customer}'); $('#customer0').validatebox('validate'); } if (null != '${model.customerTel}' && '' != '${model.customerTel}' && 'undefined' != '${model.customerTel}') { $('#customerTel0').val('${model.customerTel}'); $('#customerTel0').validatebox('validate'); }//客户区域(省)basicForm.find('#provinceForCustomerList').combobox({url : '${ctx}/customerList/customerList!getCustomerArea.action?customerArea=province',valueField : 'value',textField : 'detail',//panelHeight : 'auto',//width : '60',required : true,editable : true,missingMessage : "请选择省份",onSelect : function (data){getCity(data.value);$('#countryForCustomerList').combobox('clear');$('#countryForCustomerList').combobox('loadData',[]);}});
- EasyUI 学习笔记(一)
- jquery easyUI 学习笔记一
- PHP/EasyUI学习笔记(一) easyui的机制的思考
- EasyUI学习笔记(一)——EasyUI入门
- EasyUI学习之RSSReader应用的学习笔记(一)
- easyUI学习笔记
- easyui学习笔记
- easyui学习笔记_awei4home
- EasyUI学习笔记_1
- EasyUI学习笔记_2
- EasyUI学习笔记_3
- easyui学习笔记
- EasyUI 学习使用笔记
- EasyUI学习笔记
- easyui 学习笔记
- easyUI TreeGrid 学习笔记
- easyUI学习笔记-----datagrid
- easyUI学习笔记-----combogrid
- mysql解压版安装
- mysql分表和表分区详解
- Android--Google官方下拉刷新SwipeRefreshLayout(附加增加上拉加载)
- Andriod app开发中身份信息验证模块,利用appcan实现照片的上传
- 快速排序
- EasyUI 学习笔记(一)
- Java中Synchronized的用法
- 10条PHP高级技巧
- java服务安装(一):使用java service wrapper及maven打zip包
- MD5加密算法的java实现
- hdu_4897_Little Devil I(树链剖分)
- 浏览器 user-agent 字符串的故事
- kafka connector commit 失败
- JAVA调用BAPI创建销售订单