easyUI的合并单元格指合并行和合并列的单元格两种,这次我把这两种合并写到一起,首先说一下我所使用的环境
easyUI 版本1.5
使用的java后台使用springboot
看代码之前先看下效果图:
顶部合并单元格的代码,本菜鸟是采用后台写的,直接在页面写应该也可以,只是这里没做过多测试,有兴趣的小伙伴可以测试一下
ActionResult ar = ActionResult.New();//这个是我借鉴别人的,看不懂可以滤过,对合并单元格没用
List<List<Map<String,Object>>> list = New.list();//这种创建对象的也是借鉴别人的,跟普通的new treemap是一样的
List<Map<String,Object>> totalColumnList = New.list();
Map<String,Object> totalColumnMap = null;
int page = mapBean.getIntValue("page",0);
int size = mapBean.getIntValue("size",20);
//PagedData<Map<String, Object>> tableDataList = productService.tableColumnsList(page,size);
//这是表格的数据
List<Map<String,Object>> totalDataList = New.list();
totalColumnMap = New.map();
totalColumnMap.put("card_name","123");
totalColumnMap.put("mobile","13614781236");
totalColumnMap.put("a","56");
totalColumnMap.put("b","23");
totalColumnMap.put("v","33");
totalDataList.add(totalColumnMap);
totalColumnMap = New.map();
totalColumnMap.put("card_name","123");
totalColumnMap.put("mobile","13614781236");
totalColumnMap.put("a","56");
totalColumnMap.put("b","23");
totalColumnMap.put("v","33");
totalDataList.add(totalColumnMap);
totalColumnMap = New.map();
totalColumnMap.put("card_name","123");
totalColumnMap.put("mobile","13614781236");
totalColumnMap.put("a","56");
totalColumnMap.put("b","23");
totalColumnMap.put("v","33");
totalDataList.add(totalColumnMap);
totalColumnMap = New.map();
totalColumnMap.put("card_name","456");
totalColumnMap.put("mobile","15914783698");
totalColumnMap.