bootStrap table 和 JS 开发过程中遇到问题汇总

1..bootStrap-table表头固定

在table定义的时候给高度属性就可以自动生成滚动条,并且固定表头【height: 220,】

2.为动态生成的DOM元素绑定事件

on("click",function(){……}

3.bootStrap table 表头与tbody错乱的问题

 $("#table").bootstrapTable('resetView');

4.boootStrapTable多次提交请求的解决办法

不要在弹出的模态页的时候绑定事件,这样每次弹出都绑定一次事件的话,绑定几次他就会重复执行几次(这是个坑),所以在外面全局绑定一次就好了

5.Oracle与MySql update 的区别

update ITF_WHITE_LIST i
   set i.ONLINE_INTERFACE_ID =
       (select t.ONLINE_INTERFACE_ID
          from ITF_ONLINE_INTERFACE t
         where i.online_interface_code = t.online_interface_code
           and t.online_interface_code not in
               ('CrewLicenseService',
                'CrewWorkExpService',
                'FlightInfoqueryService',
                'FlightsPerInfoService'))
        where not exists ('CrewLicenseService',
                'CrewWorkExpService',
                'FlightInfoqueryService',
                'FlightsPerInfoService')

在MySql中执行绿色部分Sql是没有问题的,但是在Oracle中会报错,因为在MySql中

Update语句后面的关联关系默认是执行两张表的inner join 操作,但是在Oracle 中是执行left join操作,虽然'CrewLicenseService'在两张表中都存在,但是我把其中一张表里的'CrewLicenseService'过滤掉了,就会在left join 时出现空值。

6.[tooltip] bootStrap.mini.js自带的提示框效果

Tooltip;   http://v3.bootcss.com/javascript/
使用前必须初始化,option为参数配置
$('#example').tooltip(options)

例子: $(". topTitle ").tooltip({ animation: true, html: true,//title中识别html代码   template: '<div class="tooltip" role="tooltip"><class="tooltip-asd"></div><div class="tooltip-inner"></div></div>',//修改替换其自带样式 trigger: 'focus'//对话框弹出方式 });

7.decodeURIComponent(data.true) 字符串出现“+”问题

var data=$('#inParam_Edit_Add_from').serialize();
inSubmitData=
dealparam(decodeURIComponent(data.replace(/\+/g,'%20'),true));
使用javascript的decodeURIComponent函数解码查询字符串时,处理不了"+",

8.监听HTML元素大小变化 监听有个js,【jquery.ba-resize.js】

jQuery貌似自带 resize()方法,但是只能监听窗口大小变化,不能监听元素的大小变化,所以需要引入这个补丁 jquery.ba-resize.js
例如:bootstrap Table 监听DIV 大小,然后变化就出发重置表单事件,从而使表头与内容保持一致 引入这个补丁; 直接绑定相应元素,执行bootStrapTable的重置表头方法 $("#resizeId").resize(function() { $('#tb_interfaceInfos').bootstrapTable('resetView'); });

9.thymeleaf EL表达式

<ul class="macth-dropdown-menu" th:each="res,status:${resNodes}">
<li><a  th:href="@{${res.resName}}" th:text="${res.resName}">分类</a></li>
Thymeleaf本身支持EL表达式,status是记录当前for循环的一些状态,

10.add,update 返回值

成功返回值  大于   0
失败返回值  小于   0

11.radio 多次赋值无效

使用attr赋值 设置选中  表面上看OK,但是多次使用就挂了。最后才发现  是jquery高版本中,已经在使用 prop 据说使用 prop是根据 HTML元素标签中是否有自定义属性决定,
$('#apId input[value='+approve.status+']').attr("checked","checked");
$('#apId input[value='+approve.status+']').prop("checked","checked");

12.浏览器打开新页面方式

新窗口: target="_blank"
覆盖打开:target="view_window"

13.js对象转JSON字符串

JSON.stringify(param);

14.实事监听input值变化

$("#txt_search_classfy").on("input propertychange",function(){
   console.log($(this).val());
});