日期:2014-05-16 浏览次数:20372 次
var cols = new Array(); $("ul#sortable>li").each(function(){ //构造数组保存排好序选择打印的列名 if($(this).find("input:checkbox").attr("checked")){ cols.push($(this).text()); } });
cols = {"col_names":cols}; var strCols =JSON.stringify(cols);
var uri = encodeURI("testPrinter.action?set="+strSet+"&col="+strCols); window.open(uri);
String cols = (String)request.getParameter("col"); JSONObject jsonObject = JSONObject.fromObject( cols ); List col_names = JSONArray.toList( jsonObject.getJSONArray( "col_names")); System.out.println(col_names.size()); for(int i=0;i<col_names.size();i++){ System.out.println(col_names.get(i)); }
var set={"p_type":p_type.val(), "title":name.val(), "pagesize":pagesize.val(), "fontsize":fontsize.val(), "title_bold":title_bold.val(), "title_italic":title_italic.val(), "t_border":t_border.val() }; var strCols =JSON.stringify(cols); var uri = encodeURI("testPrinter.action?set="+strSet+"&col="+strCols); window.open(uri);
jsonObject = JSONObject.fromObject(json); Setting s = (Setting) JSONObject.toBean(jsonObject, Setting.class);