Easyui学习(一)

  1. 文本框控件基本操作
    //文本框赋值
     $('#userName').textbox('setValue',account['userName']);
    //读取文本框值
     $('#userName').textbox('getValue');
     
  2. 下拉列表组合框基本操作
    //下拉列表 组合框 赋值
     $('#category').combobox('setValue',account['category']);
    //下拉列表组合框读取值
     $('#category').combobox('getValue');
  3. 日期文本框基本操作
    //日期文本框赋值
    $('#regDate').datebox('setValue',account['regDate']);
    //读取日期文本框值
    $('#regDate').datebox('getValue');
  4.  对话框控件的简单应用
    //初始化一个对话框,设置对话框是关闭
    $('#'+id).dialog({
    		    title: '修改账户',
    		    width: 600,
    		    height: 400,
    		    closed: true,
    		    cache: false,
    		    draggable:false,
    		    href: url,
    		    modal: true,
    		    buttons:[{
    				text:'保存',
    				iconCls:'icon-save',
    				handler:function(){
    					// 关闭对话框
    					$('#'+id).dialog('close');
    				}
    			},{
    				text:'取消',
    				iconCls:'icon-cancel',
    				handler:function(){
    					//关闭对话框
    					$('#'+id).dialog('close');
    				}
    			}],
    			onLoad:function(){
    				//当页面加载完毕
    				...........
    		    }
    		
    			
    		});
    //打开对话框
    $('#editDialog').dialog('open');
    //刷新对话框页面
    $('#editAccountDialog').dialog('refresh', url);
     

猜你喜欢

转载自blog-chen-lian.iteye.com/blog/2344597