コード例 #1
0
        public void CreateSelect(XrmOptionSetEditor self)
        {
            string optionSet = "<SELECT>";

            // Add null value
            optionSet += string.Format("<OPTION title=\"\" value=\"\" {0}></OPTION>", self._defaultValue.Value == null ? "selected" : "");

            foreach (OptionSetItem o in _options)
            {
                optionSet += string.Format("<OPTION title=\"{0}\" value=\"{1}\" {2}>{0}</OPTION>", o.Name, o.Value, self._defaultValue.Value == o.Value ? "selected" : "");
            }
            optionSet  += "</SELECT>";
            self._input = jQuery.FromHtml(optionSet);
            self._input.Bind("keydown.nav", delegate(jQueryEvent e)
            {
                if (e.Which == 40 || e.Which == 38) //Up or Down are used on the select scrolling
                {
                    e.StopImmediatePropagation();
                }
            });

            self._input.AppendTo(_args.Container);

            self._input.Focus().Select();
        }
コード例 #2
0
 static XrmOptionSetEditor()
 {
     EditorFactory = delegate(EditorArguments args)
     {
         XrmOptionSetEditor editor = new XrmOptionSetEditor(args);
         return editor;
     };
 }
コード例 #3
0
 static XrmOptionSetEditor()
 {
     EditorFactory = delegate(EditorArguments args)
     {
         XrmOptionSetEditor editor = new XrmOptionSetEditor(args);
         return(editor);
     };
 }
コード例 #4
0
        public XrmOptionSetEditor(EditorArguments args) : base(args)
        {
            // Get the option set values
            XrmOptionSetEditor      self = this;
            OptionSetBindingOptions opts = (OptionSetBindingOptions)args.Column.Options;

            if (_options == null)
            {
                _options = MetadataCache.GetOptionSetValues(opts.entityLogicalName, opts.attributeLogicalName, opts.allowEmpty);
            }

            CreateSelect(self);
        }
コード例 #5
0
        public void CreateSelect(XrmOptionSetEditor self)
        {
            string optionSet = "<SELECT>";

            // Add null value
            optionSet += string.Format("<OPTION title=\"\" value=\"\" {0}></OPTION>", self._defaultValue.Value == null ? "selected" : "");

            foreach (OptionSetItem o in _options)
            {
                optionSet += string.Format("<OPTION title=\"{0}\" value=\"{1}\" {2}>{0}</OPTION>", o.Name, o.Value, self._defaultValue.Value == o.Value ? "selected" : "");
            }
            optionSet  += "</SELECT>";
            self._input = jQuery.FromHtml(optionSet);
            self._input.AppendTo(_args.Container);

            self._input.Focus().Select();
        }
コード例 #6
0
        public void CreateSelect(XrmOptionSetEditor self)
        {
       

            string optionSet = "<SELECT>";
            // Add null value
            optionSet += string.Format("<OPTION title=\"\" value=\"\" {0}></OPTION>", self._defaultValue.Value == null ? "selected" : "");

            foreach (OptionSetItem o in _options)
            {
                optionSet += string.Format("<OPTION title=\"{0}\" value=\"{1}\" {2}>{0}</OPTION>", o.Name, o.Value, self._defaultValue.Value == o.Value ? "selected" : "");
            }
            optionSet += "</SELECT>";
            self._input = jQuery.FromHtml(optionSet);
            self._input.Bind("keydown.nav", delegate(jQueryEvent e)
            {
                if (e.Which == 40 || e.Which == 38) //Up or Down are used on the select scrolling
                    e.StopImmediatePropagation();
            });

            self._input.AppendTo(_args.Container);

            self._input.Focus().Select();
        }
コード例 #7
0
        public void CreateSelect(XrmOptionSetEditor self)
        {
            string optionSet = "<SELECT>";
            // Add null value
            optionSet += string.Format("<OPTION title=\"\" value=\"\" {0}></OPTION>", self._defaultValue.Value == null ? "selected" : "");

            foreach (OptionSetItem o in _options)
            {
                optionSet += string.Format("<OPTION title=\"{0}\" value=\"{1}\" {2}>{0}</OPTION>", o.Name, o.Value, self._defaultValue.Value == o.Value ? "selected" : "");
            }
            optionSet += "</SELECT>";
            self._input = jQuery.FromHtml(optionSet);
            self._input.AppendTo(_args.Container);

            self._input.Focus().Select();
        }