2 qq 27080019 qq_27080019 于 2016.03.22 15:13 提问

easyUI下拉框复选不显示值

data-options="
url: '/securityAudit/statisticsByLogModule.html',
method:'get',
valueField:'data.count',
textField:'data.moduleName',
multiple:true,
width:110,
panelHeight:'auto'
"/>

                    对象数组
                    {"success":true,"message":null,"exception":false,"sessionExpired":false,"total":0,"pageBean":null,"data":[{"moduleName":"资源管理","count":12594},{"moduleName":"车辆管理","count":4172},{"moduleName":"用户登录","count":978},{"moduleName":"用户管理","count":778},{"moduleName":"卡口管理","count":595},{"moduleName":"组织机构管理","count":588},{"moduleName":"角色管理","count":229},{"moduleName":"字典数据管理","count":3}]}

                    上面那个取值是不是错了,应该怎么取

2个回答

zhangsiqiong
zhangsiqiong   2016.03.22 17:09

在onLoadSuccess事件中赋值

liyangax
liyangax   2016.03.22 18:32

参数错了,重新创建对象,每个对象保存一个key和value。转化后JSON格式是这样的[{
"id":1,
"text":"Java",
"desc":"Write once, run anywhere"
},{
"id":2,
"text":"C#",
"desc":"One of the programming languages designed for the Common Language Infrastructure"
},{
"id":3,
"text":"Ruby",
"selected":true,
"desc":"A dynamic, reflective, general-purpose object-oriented programming language"
},{
"id":4,
"text":"Perl",
"desc":"A high-level, general-purpose, interpreted, dynamic programming language"
},{
"id":5,
"text":"Basic",
"desc":"A family of general-purpose, high-level programming languages"
}]






qq_27080019
qq_27080019 解决了,用json解析一下我的数据就好了,谢谢
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!