how to re initialise jquery.mentionsInput on the edit view after its been
created
I am using the jquery.mentionsInput to recreate the feature that Facebook
and Twitter have for mentioning people in posts. My initial function that
I call on the new page is:
$('textarea.mention').mentionsInput({
onDataRequest:function (mode, query, callback) {
$.getJSON('api/users/user_mentions?q=' + query, function(responseData) {
responseData = _.filter(responseData, function(item) { return
item.name.toLowerCase().indexOf(query.toLowerCase()) > -1 });
callback.call(this, responseData);
});
}
});
That works fine and whats stored in the database is:
@[Jake McAllister](content:5) How are you doing?
and then when I get to the edit page I can't get the textarea to
reinitialise itself as before. Does anybody know how to get this to
reinitialise and work like its meant to?
(see the demo on the github page to get how it's meant to work)
No comments:
Post a Comment