jQuery MiniUI

标题: 关于combox如何存放后台数据 [打印本页]

作者: lifestyle.m1k    时间: 2012-7-25 16:33:56     标题: 关于combox如何存放后台数据

DetectionService ds = new DetectionService();
  List<Detection> comboxList = ds.searchComboxList();
  
  List<String> text = new ArrayList<String>();
  List<String> value = new ArrayList<String>();
  for(Detection d:comboxList){
   text.add(d.getSource_idc());
   value.add(d.getSource_ip());
  }
  
  JSONObject jsonObj = new JSONObject();
  jsonObj.accumulate("name", text);
  jsonObj.accumulate("ip", value);
  
  String combox = JSONSerializer.toJSON(jsonObj).toString();
  System.out.println(combox);
  response.getWriter().write(combox);
  response.getWriter().flush();
  response.getWriter().close();


当前combox中的数据为:

{"name":["xxxxx","xxxxx2"],"ip":["127.0.0.1","127.0.0.2"]}

在页面上如何通过textFiled和valueFiled进行设置填充?

我用的是jsp页面


作者: factory    时间: 2012-7-25 16:55:26

你可以选择setData或者给URL的方式加载数据
http://miniui.com/demo/index.html#src=combobox/combobox.html
作者: lifestyle.m1k    时间: 2012-7-26 11:21:38

谢谢已经解决了。




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2