首页 > 其他 > 详细

个人日常笔记

时间:2015-10-12 12:28:46      阅读:189      评论:0      收藏:0      [点我收藏+]
1. datebox设置默认时间
$(document).ready(function() {    
         $("#start").datebox("setValue",myformatter( new Date()));
         $("#end").datebox("setValue",myformatter( new Date()));
         /* $(".datebox :text").attr("readonly","readonly"); */
    });

    function myformatter(date){  
        var y = date.getFullYear();  
        var m = date.getMonth()+1;  
        var d = date.getDate();  
        return y+‘-‘+(m<10?(‘0‘+m):m)+‘-‘+(d<10?(‘0‘+d):d);  
    }

2.easyui input设置为日期 class="easyui-datebox"

class="easyui-datetimebox"  带时分秒

 

3.easyui input标签动态变成下拉框

供货商:<input type="text" id="from_customer_id" style="width:70px;height:20px;" />
    $(‘#from_customer_id‘).combobox({   
                  url:‘${ctx}/admin/repo_tool/listSelect‘,   
                  valueField:‘id‘,   
                  textField:‘customername‘,
                  panelHeight:‘100‘,
                  editable:false,
            });    
    Controller方法加头:@RequestMapping("/listSelect")
                        @ResponseBody        

    如果想获取下拉框的值  用这个:  .combobox("getValue");

4. 背景图为灰色

background-color:rgb(235, 235, 228)"

5. 输入框去空格

onkeyup="value=value.replace(/\s/g,‘‘)"

6. 输入框只能输入数字以及去空格

onkeyup="this.value=this.value.replace(/\D/g,‘‘)"  onafterpaste="this.value=this.value.replace(/\D/g,‘‘)"

7. 边框为灰色,背景也为灰色

style=‘background-color:#ccc;border-bottom:2px solid #ccc‘

8. jquery 获取easyui combobox选中的值

$(‘#comboboxlist‘).combobox(‘getValue‘);

 

个人日常笔记

原文:http://www.cnblogs.com/weiloong/p/4871188.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!