zoukankan      html  css  js  c++  java
  • jqgrid学习(三)

    1.修改jqgrid自带的行编辑按钮样式

    //jqgrid默认的行编辑样式
    {
                                  name : '',
                                  index : '',
                                  width : 70,
                                  fixed : true,
                                  sortable : false,
                                  resize : false,
                                  formatter : 'actions',
                                  
                                },
    
    //修改每行的编辑按钮图标为目标样式
    
    //当表格中数据加载完毕后,执行此方法
    loadComplete : function() {
                              var table = this;
     	                      //$("div[data-original-title='编辑'] span").attr("class","ui-icon fa-puzzle-piece cyan");	
                              setTimeout(
                                  function() {
                                    styleCheckbox(table);
                                    updateActionIcons(table);
                                    updatePagerIcons(table);
                                    enableTooltips(table);
                                    
                                    //修改'actions'中默认的编辑按钮的样式为装配,以及对当鼠标移到该按钮时的提示的修改
                                    $(grid_selector).find('tbody').each(function () {
                                    	$(this).find('tr').each(function () {
                                    		var id =$(this).attr("id");
                                    		$("#jEditButton_"+id).attr("data-original-title","装配")
                                    		$("#jEditButton_"+id).find("span").attr("class","");
                                    		$("#jEditButton_"+id).find("span").attr("class","ui-icon fa-puzzle-piece cyan");
                                    	});
                                    	
                                    });
                                  
                                  }, 0);
                  }

    2.设置自定义表单验证规则

    editrules : {
                                    required : true,
                                    custom:true, 
                                    custom_func: function(value, colname){
                                    	if(value == '0'){ // 表明表单验证未通过,会自动弹出提示框
                                    		return [false,"必须选择存在的设备编码!"];
                                    	}else{ // 表明表单验证通过,此时不会弹出提示
                                    		return [true,""];
                                    	}
                                    }
                                  },
    

      

  • 相关阅读:
    Codeforces Round #548
    省选前的th题
    省选前多项式的挣扎
    2019.3.18考试&2019.3.19考试&2019.3.21考试
    省选前的反演抢救计划
    2019.3.16 noiac的原题模拟赛
    AtCoder Regular Contest 069 F
    Atcoder Grand 012 C
    Atcoder Grand 011 C
    Atcoder Grand 006 C-Rabbit Exercise
  • 原文地址:https://www.cnblogs.com/grj0011/p/7428942.html
Copyright © 2011-2022 走看看