要替换原始值,我使用Tabulator的“查找”功能。
但是“选择”和“自动完成”的行为不同
var country_list = {
1: "Germany",
2: "Ukraine",
3: "Canada",
};
//Build Tabulator
var table = new Tabulator("#example-table", {
height:"311px",
data: tabledata,
columns:[
{title:"ID", field:"id", width:40 },
{title:"Country", field:"country_id", width:130,
editor:"select",
editorParams:{values: country_list, },
formatter : "lookup",
formatterParams : country_list,
},
{title:"Country2", field:"country_id", width:130,
editor:"autocomplete",
editorParams:{values: country_list, },
formatter : "lookup",
formatterParams : country_list,
},
],
});
尝试编辑Country
和Country2
字段:
JSFiddle
“选择”显示标签,但“自动完成”显示原始值。
这种行为是否一致?如果是,如何强制 Tabulator 隐藏原始值?