Skip to content

Instantly share code, notes, and snippets.

@iamntz
Forked from andySF/gist:3905002
Created October 17, 2012 11:15
Show Gist options
  • Save iamntz/3905006 to your computer and use it in GitHub Desktop.
Save iamntz/3905006 to your computer and use it in GitHub Desktop.
$('.typeahead').typeahead({
});
$('.group').on('change', 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