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(); }
static XrmOptionSetEditor() { EditorFactory = delegate(EditorArguments args) { XrmOptionSetEditor editor = new XrmOptionSetEditor(args); return editor; }; }
static XrmOptionSetEditor() { EditorFactory = delegate(EditorArguments args) { XrmOptionSetEditor editor = new XrmOptionSetEditor(args); return(editor); }; }
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); }
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(); }
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(); }