formatter转换ID为值
设置字典缓存
var DictionaryItem = {};
$.post('/Dictionary/GetDictionary/T_RKXD', function (json) {
$.data(DictionaryItem, 'XD', json);
});
替换ID为值
function formatDic(value, row) {
return getText("XD", value);
}
function getText(code, value) {
var _DictionaryItem = $.data(DictionaryItem, code);
for (var i = 0; i < _DictionaryItem.length; i++) {
if (_DictionaryItem[i].id == value) {
return _DictionaryItem[i].text;
}
}
}