我正在使用Tokenize2库,需要检查用户是否有权删除特定标记。以下是我的代码:
$('.tokenize').tokenize2({
dataSource: tagsurl,
placeholder: 'Add tags for images images.',
searchMinLength: 3
});
$('.tokenize').on("tokenize:tokens:remove", function(e, value) {
var checkPermission = checkpermission(userpermissiontagurl, value);
if (checkPermission) {
tokensetup(removetagurl, value);
}
return 0;
});
问题是它仍然隐藏了该标签。如果用户无法删除标签,如何停止标记?谢谢!