1.7

Table Of Contents
var $body = $("#search>div#group").children
("div.rule-body"),
search = {
"entity": $("#entity").val(),
"search": {
"operator": $body
.children("div")
.children("#operator")
.val(),
"rules": processSearchRule
($body.children("div.sub-rules"))
}
};
/** Add Sorting & Grouping Rules */
["sort", "group"].forEach(function (type) {
$("#" + type + "ing div.sub-rules div.rule")
.each(function (index, element) {
var $body = $(element).children
("div.rule-body"),
rule = {
"name": $body
.find("#name")
.val(),
"order": $body
.find("#order")
.val(),
"type": element.id
};
var $numeric = $body.find
("#numeric");
if ($numeric.length) {
rule.numeric = $numeric.is
(":checked");
}
if (!search[type]) { search[type] = [];
}
search[type].push(rule);
});
});
$.ajax({
type: "PUT",
Page 133