Skip to content

Instantly share code, notes, and snippets.

@andySF
Created October 17, 2012 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andySF/3905002 to your computer and use it in GitHub Desktop.
Save andySF/3905002 to your computer and use it in GitHub Desktop.
$('.typeahead').typeahead({
});
$('.group').focusout(function (e) {
if (e.target.value == "") {
return;
}
var _this = this;
$.ajax({
type: 'POST',
data: e.target.value,
dataType: 'json',
url: 'Machines/UpadateGroupForMachine?id=' + $(this).attr('data-id') + '&group=' + e.target.value,
success: function (result) {
if (result == 'success') {
$(_this).replaceWith(e.target.value);
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment