TextBox

扩展自 $.fn.validatebox.defaults. 重写 $.fn.textbox.defaults.

TextBox 是加强的输入控件,使我们建设表单更加快捷. 是一些复杂控件的基础控件,比如 combo,datebox,spinner,等等.

依赖

  • validatebox
  • linkbutton

实例

html创建方式

<input class="easyui-textbox" data-options="iconCls:'icon-search'" style="width:300px"> 

javascript创建方式

<input id="tb" type="text" style="width:300px">
$('#tb').textbox({
buttonText:'Search',
iconCls:'icon-man',
iconAlign:'left'
})

属性

属性拓展自 validatebox 控件,下面是textbox新添加的属性:

Name Type Description Default
width number The width of the component. auto
height number The height of the component. 22
prompt string The prompt message to be displayed in input box. ''
value string The default value.  
type string The textbox type. Possible values are 'text' and 'password'. text
multiline boolean Defines if this is a multiline textbox. false
editable boolean Defines if user can type text directly into the field. true
disabled boolean Defines if to disable the field. false
readonly boolean Defines if the component is read-only. false
icons array The icons attached to the textbox. Each item has the following properties:
iconCls: string, the icon class.
disabled: boolean, indicate if the icon is disabled.
handler: function, the function to process the clicking action on this icon.

Code example:

$('#tb').textbox({
icons: [{
iconCls:'icon-add',
handler: function(e){
$(e.data.target).textbox('setValue', 'Something added!');
}
},{
iconCls:'icon-remove',
handler: function(e){
$(e.data.target).textbox('clear');
}
}]
})
[]
iconCls string The background icon displayed on the textbox. null
iconAlign string Position of the icons. Possible values are 'left','right'. right
iconWidth number The icon width. 18
buttonText string The displaying text of button that attached to the textbox.  
buttonIcon string The displaying icon of button that attached to the textbox. null
buttonAlign string Position of the button. Possible values are 'left','right'. right

事件

事件拓展自 validatebox 控件,下面是textbox新添加的事件:

Name Parameters Description
onChange newValue,oldValue Fires when the field value is changed.
onResize width,height Fires when the textbox is resized.
onClickButton none Fires when the user click the button.
onClickIcon index Fires when the user click a icon.

方法

方法拓展自 validatebox 控件,下面是textbox新添加的方法:

Name Parameter Description
options none Return the options object.
textbox none Return the textbox object.
button none Return the button object.
destroy none Destroy the textbox component.
resize width Resize the component width.
disable none Disable the component.
enable none Enable the component.
readonly mode Enable/Disable readonly mode.

Code example:

$('#tb').textbox('readonly');	// enable readonly mode
$('#tb').textbox('readonly',true); // eanble readonly mode
$('#tb').textbox('readonly',false); // disable readonly mode
clear none Clear the component value.
reset none Reset the component value.
setText text Set the displaying text value.
getText none Get the displaying text value.
setValue value Set the component value.
getValue none Get the component value.
getIcon index Get specified icon object.

FileBox

拓展自 $.fn.textbox.defaults. 重写 $.fn.filebox.defaults.

由于浏览器安全问题, 一些方法 比如 'setValue' 不能使用filebox 组件.

依赖

  • textbox

实例

html创建方式

<input class="easyui-filebox" style="width:300px"> 

javascript创建方式

<input id="fb" type="text" style="width:300px">
$('#fb').filebox({
buttonText: 'Choose File',
buttonAlign: 'left'
})

属性

属性拓展自 textbox, 下面是 filebox新增属性.

Name Type Description Default
buttonText string The displaying text of button that attached to the textbox. Choose File
buttonIcon string The displaying icon of button that attached to the textbox. null
buttonAlign string Position of the button. Possible values are 'left','right'. right

事件

事件拓展自 textbox.

方法

方法拓展自 textbox.

easyui-textbox的更多相关文章

  1. EasyUI TextBox的onkeypress事件

    关于EasyUI TextBox的事件好像不多,像keypress,keydown在textbox的事件里都没有,所以要用这些事件要采取一些特殊的方法,今天用到了这些就记录一下,有两种方法 方法1: ...

  2. jquery easyui textbox onblur事件,textbox blur事件无效解决方案

    jquery easyui textbox onblur事件,textbox blur事件无效解决方案 >>>>>>>>>>>> ...

  3. EasyUI TextBox的keypress

    关于EasyUI TextBox的事件好像不多,像keypress,keydown在textbox的事件里都没有,所以要用这些事件要采取一些特殊的方法,今天用到了这些就记录一下,有两种方法, 第一种: ...

  4. easyui textbox 设置只读不可编辑状态

    在使用easyul的时候,发现输入框内容及不容易获取与设置,用jQuery的方式大部分失效.依稀记得好像是因为easyul会在原页面的基础上,生成了一些新的独有样式,并且暂时覆盖掉使用了easyul的 ...

  5. easyui textbox 内容改变事件 增加oninpu 类似事件,

    //======================利用easyui验证功能,进行内容变化监控=== =============$(function () { var CustomerService = ...

  6. easyui textbox 赋值

    $('#fireInfo').textbox('setValue', tempData.fireInfo); $('#fireStartTime').datetimebox('setValue', t ...

  7. easyui textbox 添加 onblur 失去焦点事件

    由于textbox不能触发onblur事件,需要换种方式解决问题,方案如下: <input type="text" class="easyui-textbox&qu ...

  8. easyui textbox event 添加

    $('#tt').textbox({ inputEvents:$.extend({},$.fn.textbox.defaults.inputEvents,{ keyup:function(e){ co ...

  9. easyui textbox 获取焦点

    function Admin_ListAdd() { $('#ListInfo').css({ display: "inherit" }); $("#Department ...

  10. easyui textbox 输入小写自动变大写,easyui textbox 绑定oninput事件 easyui textbox 绑定propertychange事件

    <input id="id" class="easyui-textbox" name="id" value="@Model. ...

随机推荐

  1. C#微信公众号开发系列教程(接收事件推送与消息排重)

    微信服务器在5秒内收不到响应会断掉连接,并且重新发起请求,总共重试三次.这样的话,问题就来了.有这样一个场景:当用户关注微信账号时,获取当前用户信息,然后将信息写到数据库中.类似于pc端网站的注册.可 ...

  2. jquery图片播放插件Fancybox(灯箱)

    效果预览Demo源码下载 Fancybox的特点如下: 可以支持图片.html文本.flash动画.iframe以及ajax的支持 可以自定义播放器的CSS样式 可以以组的形式进行播放 如果将鼠标滚动 ...

  3. 使用console进行性能测试和计算代码运行时间

    对于前端开发人员,在开发过程中经常需要监控某些表达式或变量的值,如果使用用debugger会显得过于笨重,最常用的方法是会将值输出到控制台上方便调试.最常用的语句就是console.log(expre ...

  4. selenium-ide学习

    最近想把selenium给系统的学习下.主要因为它开源,且适配多个浏览器多种语言. selenium主要由selenium-ide.selenium1.selenium2.selenium guird ...

  5. Phonegap3.4 教程

    英文原扯:http://coenraets.org/blog/cordova-phonegap-3-tutorial/ 我只是对着原文学习一遍,记录在这里,一来为了加深印象(边翻译边学习),二来为了自 ...

  6. maven,spring,mybatis集成错误

    maven,spring,mybatis集成的时候单元测试junit测试没问题,但mvn jetty:run 就报错误 错误: org.apache.ibatis.binding.BindingExc ...

  7. Xmind Pro 3.4.0.201311050558 Xmind 3.4 破解版 Crack

    其实就一个附件.某大神那里的下不到了.从这里就好了. 使用方法请参见压缩包~ 如果连接不能用了请及时告知回复.>< 仅适用于与版本号为201311050558的Xmind.当然尊重正版开发 ...

  8. google搜索新姿势

    大前提:英文Google→http://www.google.com或http://www.google.cn 第一篇 在搜索框上输入:"indexof/"inurl:lib 再按 ...

  9. cmd 里面运行git提示“不是内部或外部命令,也不是可运行的程序”的解决办法

    1.找到你电脑上的git安装中bin的路径,如:E:\安装吧\Git\Git\bin:同时,找到git安装路径中git-core的位置,如:E:\安装吧\Git\Git\libexec\git-cor ...

  10. PAT 1034. Head of a Gang (30)

    题目地址:http://pat.zju.edu.cn/contests/pat-a-practise/1034 此题考查并查集的应用,要熟悉在合并的时候存储信息: #include <iostr ...