您的位置:首页 > 其它

datagrid combobox的显示值的问题

2017-08-02 09:56 369 查看
function getman(a) {
$.post("for_job.ashx", { action: "getjob", id: a }, function (data) {
jobdata = data;
getman2(a, data)
}, "json")
}
function getman2(a,b) {

$('#mantable').edatagrid({
fit: true,
rownumbers: true,
singleSelect: true,
url: 'for_emplyee.ashx',
toolbar: "#departmentbuttons",
queryParams: {
action: "getdepartmentman",
id: a
},
columns: [[
{ field: "id", title: "标识", width: 50, hidden: true },
{ field: "userid", title: "工号", width: 80, editor: "text", align: "center" },
{ field: "name", title: "姓名", width: 100, editor: "text", align: "center" },
{
field: "jobid", title: "岗位", width: 150, formatter: function (value, row) {
//////这里是关健,对比找出显示值
for (var i = 0; i < jobdata.length; i++) {
if (jobdata[i].sid == value) {
return jobdata[i].jobname;
}
}
}, editor:
{
type: 'combobox',
options: {
valueField: 'sid',
textField: 'jobname',
data: jobdata,
},
required: false
}
},
{ field: "u_order", title: "序号", width: 100, editor: "numberbox", align: "center" },
{ field: "office_tel", title: "办公电话", width: 150, editor: "numberbox", align: "center" },
{ field: "tel", title: "手机号码", width: 150, editor: "numberbox", align: "center" },
{ field: "office_no", title: "办公室", width: 120, editor: "text", align: "center" },
{ field: "onjob", title: "在职情况", width: 100, editor:
{
type: 'combobox', options: {
valueField: 'onjobvalue', textField: 'onjobtext', data: [{ onjobtext: "在职", onjobvalue: "在职" }, { onjobtext: "离职", onjobvalue: "离职" }]
,required:true}}
},
{ field: "departmentid", title: "所在部门ID", width: 250, hidden: true }
]]
});
}
getman('-');



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: