Skip to content

Instantly share code, notes, and snippets.

@jonhilt
Created May 26, 2010 12:59
Show Gist options
  • Save jonhilt/414436 to your computer and use it in GitHub Desktop.
Save jonhilt/414436 to your computer and use it in GitHub Desktop.
$('#saveChanges').click(function () {
var rules = new Array();
$('#assignedRules table.ruleTable tbody tr').each(function (i) {
var subRuleCode = $('#subRuleCode', this).val();
var productGroupId = $('#productGroupId', this).val();
rules.push(new Rule(subRuleCode, productGroupId));
});
var postData = JSON.stringify(rules); ;
$.ajax({
url: '/rule/SaveUserRules',
data: postData,
contentType: 'application/json',
dataType: 'json',
type: 'post',
success: onRulesSaved,
error: function (data, textStatus) { alert(textStatus); }
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment