jqGrid改變列表顯示/格式化

如果grid列表後端存的是碼錶值 前端需要顯示字符串 如下操作:

{
							label : $.i18n.prop("leaveType", "假別"),
							name : 'leaveType',
							sortable : false,
							formatter : function(cellvalue, options, rowObject) {
								if (cellvalue == "10") {
									return "事假";
								} else if (cellvalue == "11") {
									return "產假";
								} else if (cellvalue == "12") {
									return "婚假";
								} else if (cellvalue == "13") {
									return "喪假";
								} else if (cellvalue == "14") {
									return "休假";
								} else if (cellvalue == "15") {
									return "探親假";
								}
							}
						},

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章