1.onLoadSuccess()
此方法在Bootstarp Table数据成功加载返回后触发,参数为data(注意:data传入的数据是分页后的数据,并不是所有查询出来的数据,如果limit为10,那么就是10条数据),此时表格行数据尚未渲染,此时可以对数据进行更新或取值操作。
2.onPostBody()
此方法在Bootstarp Table 行数据渲染后触发,参数为data,此时要注意,如果执行了上面的updateRow操作,由于表格刷新了,所以又会触发onPostBody(),然后会陷入死循环,导致页面数据一直加载不出来。
div居中问题:
var $gongneng=$(".content .item:nth-child(2) .merge "); var parentHeight3=parseInt($gongneng.parent().css("height")); $gongneng.css("margin-top",(parentHeight3-50)*0.35+"px");
通过js获取当前模块属性
然后获取要居中模块的空白处高度
获取50%的高度。
$(this).css("display","inline");
$(this).siblings("span").remove();
$(this).css("display","inline");
$(this).siblings("span").remove();
$(this).css("display","inline");
$(this).siblings("spa是 n").remove();
$(this).css("display","inline");
$(this).siblings("span").remove();
$(this).css("display","inline");
$(this).siblings("span").remove();
$(this).css("display","inline");
$(this).siblings("span").remove();