1.7

Table Of Contents
.children()
.each(function (index, element) {
var $element = $(element),
name = $element.val();
if ($.inArray(name, options) < 0) {
$element.attr("hidden", "hidden");
if ($typeSelector.val() === name) {
$typeSelector.val(options[0]);
}
} else {
$element.removeAttr("hidden");
}
});
}
/** Restrict Rule Type Selectors to Entity Specific
Options */
var types = ["search", "sorting", "grouping"],
i;
for (i = 0; i < types.length; i += 1) {
setRuleTypeSelector(types[i], options);
}
/**
* Prompt User & Remove any Existing Rules that are
* incompatible with currently Entity type selected
**/
var $existingRules = $("div.rule"),
incompatible = [];
$existingRules.each(function (index, element) {
if ($.inArray(element.id, options) < 0) {
incompatible.push(index);
}
});
if (incompatible.length > 0) {
if (confirm("The entity type selected isn't
compatible " +
"with some of the existing rules
and these " +
"will need to be removed.\n\nAre "
+
"you sure you wish to continue ?"))
{
Page 126