var rows = dataGridSelMore(datagrid);
//遍历数组
$.each(rows,function (i,obj) {
//遍历对象
$.each(obj,function (name,value) {
console.log(name)
console.log(value)
})
})
//对象获取,通过outerHTML 输出
var input = $('<input type="text" />');
input.attr('name', this.field)
.attr('id', this.field + '_' + row.id)
.attr('class', 'easyui-numberbox')
.attr('value', row.weight || '0.0')
//.attr('readonly', true)
.attr('data-options', this['formatterOptions']);
return input.prop('outerHTML');
//Jquery 简单的进度条
//打开
$.messager.progress({title: '系统提示',msg: '正在保存,请稍候……',text:''})
//关闭
$.messager.progress('close');
select 表标签 二级联动
$('#city').on('change', function(){
var op = $(this);
var id = op.find('option:selected').attr('alt');
if ('' != id) {
if (!ops2[id]) {
//异步获取二级联动的数据
$.getJSON('questionCategory/listRegionForOptions.do?id=' + id, function(result) {
resetOptions($('#region'), result);
});
} else {
resetOptions($('#region'), ops1[id]);
}
}
});
//移除,再添加
function resetOptions(jobj, options) {
//排序第一个
jobj.find('option').not(jobj.find('option:eq(0)')).remove();
$.each(options, function(i) {
console.log(this);
jobj.append($('<option value="' + this.name + '" alt="' + this.id + '" >' + this.name + '</options>'));
});
}
将 1 转为 0001 (整形 转 字符串),用于生成流水号
String.format("-%04d",(Integer)arrivalNum+1);
jsp 到出excel 图片大小设置 不能加 px
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName()+":" + request.getServerPort() + path + "/";
String fileName = (String) request.getAttribute("fileName");
fileName=new String(fileName.getBytes("UTF-8"), "ISO8859-1" );
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
%>
<%--插入图片--%>
<img height="30" width="120" src="userpic/5e6cb1542a67465ca57eaf82e5eb44f5.jpg"/><br>
//高度自适应
<div style="width=300px;word-break:break-all; word-wrap:break-word;white-space:pre-wrap;">