Reputation: 196499
i have a list of tags on a website next to each link and i want to allow users to edit this list (add, remove, modify)
i want to come up with a slick way so they can do this without it feeling klunky so things like autocomplete, ajax without going to the server, etc
have you seen any examples of really sleek ways of supporting this.
my first thought (which i am attempting now) is to have a button next to the tags (edit) and when you click on it, it turns the link into a textbox where you can edit (autocomplete) and hit enter to commit.
other ideas are welcome . .
Upvotes: 0
Views: 93
Reputation: 514
Not sure what you mean by 'ajax without going to the server', but replacing DOM elements in jquery using ajax with server generated html could be easily done using something like
function replaceTag(elementId, pageUrl) {
$.ajax({
type: "POST",
url: pageurl + elementId,
success: function(response) {
$("#" + elementId).after(response).remove();
}
});
}
(untested code)
Upvotes: 0
Reputation: 2282
I have seen implemented a jQuery Inline edit combined with an facebook style autocomplete. You click the "Tags" part of the label autocomplete and start entering the tags. I thought it was very nifty.
Upvotes: 3