Beispiel #1
0
        private void RowOperatorChange(jQueryObject row)
        {
            if (row.Length == 0)
            {
                return;
            }

            jQueryObject editorDiv = row.Children("div.v");

            editorDiv.Html("");

            IFiltering filtering = GetFilteringFor(row);

            if (filtering == null)
            {
                return;
            }

            var operatorSelect = row.Children("div.o").Find("input.op-select").GetWidget <OperatorSelect>();

            if (operatorSelect.Value.IsEmptyOrNull())
            {
                return;
            }

            var op = filtering.GetOperators().FirstOrDefault(x => x.Key == operatorSelect.Value);

            if (op == null)
            {
                return;
            }

            filtering.Operator = op;
            filtering.CreateEditor();
        }
Beispiel #2
0
        private void PopulateOperatorList(jQueryObject row)
        {
            row.Children("div.o").Html("");

            IFiltering filtering = GetFilteringFor(row);

            if (filtering == null)
            {
                return;
            }

            var hidden = row.Children("div.o").Html("<input/>").Children().Attribute("type", "hidden").AddClass("op-select");

            var operators = filtering.GetOperators();

            new OperatorSelect(hidden, operators).ChangeSelect2(OnRowOperatorChange);
        }