I'm using the plugin found at http://loopj.com/jquery-tokeninput/ in a field which creates a list of users with admin access to a web application.
Searching, adding and removing users works perfectly.
However, I want to use the 'readonly' functionality to stop people removing themselves from the list (which would cause an issue since they wouldn't be able to see the page).
The plugin suggests adding the "readonly" : true
attribute to the JSON which sets the page up. I have done this but I am still able to remove myself.
This is the function generated. Can anyone see what's wrong with it?
$("#admin_users").tokenInput("/people/select", {
prePopulate: [
{
"id": 1,
"name": "Kevin Hughes",
"readonly": true
}, {
"id": 3,
"name": "Caroline Hughes",
"readonly": false
}
]
});
As I say, apart from the readonly
bit, it works fine.
Extra info: I'm also using Bootstrap on the page. Could this have any interaction?