internal static bool AreDefault(this JqGridNavigatorDeleteActionOptions navigatorDeleteActionOptions)
 {
     return(((navigatorDeleteActionOptions.CancelButtonIcon == null) || navigatorDeleteActionOptions.CancelButtonIcon.Equals(JqGridFormButtonIcon.CancelIcon)) &&
            ((navigatorDeleteActionOptions.DeleteButtonIcon == null) || navigatorDeleteActionOptions.DeleteButtonIcon.Equals(JqGridFormButtonIcon.DeleteIcon)) &&
            (navigatorDeleteActionOptions.Width == JqGridOptionsDefaults.Navigator.DeleteActionWidth) &&
            (navigatorDeleteActionOptions as JqGridNavigatorModifyActionOptions).AreDefault());
 }
        /// <summary>
        /// Initializes new instance of JqGridColumnFormatterOptions class.
        /// </summary>
        /// <param name="formatter">Predefined formatter</param>
        public JqGridColumnFormatterOptions(string formatter)
            : this()
        {
            switch (formatter)
            {
            case JqGridPredefinedFormatters.Integer:
                DefaultValue       = JqGridOptionsDefaults.ColumnModel.Formatter.IntegerDefaultValue;
                ThousandsSeparator = JqGridOptionsDefaults.ColumnModel.Formatter.ThousandsSeparator;
                break;

            case JqGridPredefinedFormatters.Number:
                DecimalPlaces      = JqGridOptionsDefaults.ColumnModel.Formatter.DecimalPlaces;
                DecimalSeparator   = JqGridOptionsDefaults.ColumnModel.Formatter.DecimalSeparator;
                DefaultValue       = JqGridOptionsDefaults.ColumnModel.Formatter.NumberDefaultValue;
                ThousandsSeparator = JqGridOptionsDefaults.ColumnModel.Formatter.ThousandsSeparator;
                break;

            case JqGridPredefinedFormatters.Currency:
                DecimalPlaces      = JqGridOptionsDefaults.ColumnModel.Formatter.DecimalPlaces;
                DecimalSeparator   = JqGridOptionsDefaults.ColumnModel.Formatter.DecimalSeparator;
                DefaultValue       = JqGridOptionsDefaults.ColumnModel.Formatter.CurrencyDefaultValue;
                ThousandsSeparator = JqGridOptionsDefaults.ColumnModel.Formatter.ThousandsSeparator;
                break;

            case JqGridPredefinedFormatters.Actions:
                InlineEditingOptions = new JqGridInlineNavigatorActionOptions();
                DeleteOptions        = new JqGridNavigatorDeleteActionOptions();
                break;
            }
        }
 /// <summary>
 /// Initializes new instance of JqGridColumnFormatterOptions class.
 /// </summary>
 public JqGridColumnFormatterOptions()
 {
     DecimalPlaces      = 0;
     DecimalSeparator   = String.Empty;
     DefaultValue       = String.Empty;
     Disabled           = JqGridOptionsDefaults.ColumnModel.Formatter.Disabled;
     ThousandsSeparator = String.Empty;
     Prefix             = String.Empty;
     Suffix             = String.Empty;
     SourceFormat       = JqGridOptionsDefaults.ColumnModel.Formatter.SourceFormat;
     OutputFormat       = JqGridOptionsDefaults.ColumnModel.Formatter.OutputFormat;
     BaseLinkUrl        = String.Empty;
     ShowAction         = String.Empty;
     AddParam           = String.Empty;
     Target             = String.Empty;
     IdName             = JqGridOptionsDefaults.ColumnModel.Formatter.IdName;
     EditButton         = JqGridOptionsDefaults.ColumnModel.Formatter.EditButton;
     DeleteButton       = JqGridOptionsDefaults.ColumnModel.Formatter.DeleteButton;
     UseFormEditing     = JqGridOptionsDefaults.ColumnModel.Formatter.UseFormEditing;
     PrimaryIcon        = String.Empty;
     SecondaryIcon      = String.Empty;
     Label = String.Empty;
     Text  = JqGridOptionsDefaults.ColumnModel.Formatter.Text;
     InlineEditingOptions = null;
     FormEditingOptions   = null;
     DeleteOptions        = null;
 }
 /// <summary>
 /// Initializes new instance of JqGridColumnInlineEditingOptions class.
 /// </summary>
 public JqGridColumnInlineEditingOptions()
 {
     Keys                 = JqGridOptionsDefaults.ColumnModel.Formatter.Keys;
     EditButton           = JqGridOptionsDefaults.ColumnModel.Formatter.EditButton;
     DeleteButton         = JqGridOptionsDefaults.ColumnModel.Formatter.DeleteButton;
     UseFormEditing       = JqGridOptionsDefaults.ColumnModel.Formatter.UseFormEditing;
     InlineEditingOptions = null;
     FormEditingOptions   = null;
     DeleteOptions        = null;
 }
示例#5
0
        /// <summary>
        /// Initializes new instance of JqGridActionsColumnOptions class.
        /// </summary>
        public JqGridActionsColumnOptions(string name)
            : base()
        {
            Name = name;

            Position = 0;
            Width    = 60;

            InlineEditingOptions = new JqGridInlineNavigatorActionOptions();
            DeleteOptions        = new JqGridNavigatorDeleteActionOptions();
        }
        internal static StringBuilder AppendNavigatorDeleteActionOptions(this StringBuilder javaScriptBuilder, string fieldName, JqGridNavigatorDeleteActionOptions navigatorDeleteActionOptions, IJqGridJsonService jqGridJsonService)
        {
            if ((navigatorDeleteActionOptions != null) && !navigatorDeleteActionOptions.AreDefault())
            {
                if (String.IsNullOrWhiteSpace(fieldName))
                {
                    javaScriptBuilder.Append(",").AppendJavaScriptObjectOpening();
                }
                else
                {
                    javaScriptBuilder.AppendJavaScriptObjectFieldOpening(fieldName);
                }

                javaScriptBuilder.AppendNavigatorModifyActionOptions(navigatorDeleteActionOptions)
                .AppendJavaScriptObjectIntegerField(JqGridOptionsNames.Navigator.WIDTH, navigatorDeleteActionOptions.Width, JqGridOptionsDefaults.Navigator.DeleteActionWidth)
                .AppendJavaScriptObjectObjectField(JqGridOptionsNames.Navigator.AJAX_DELETE_OPTIONS, navigatorDeleteActionOptions.AjaxOptions, jqGridJsonService)
                .AppendJavaScriptObjectScriptOrObjectField(JqGridOptionsNames.Navigator.DELETE_EXTRA_DATA, navigatorDeleteActionOptions.ExtraDataScript, navigatorDeleteActionOptions.ExtraData, jqGridJsonService)
                .AppendJavaScriptObjectFunctionField(JqGridOptionsNames.Navigator.SERIALIZE_DELETE_DATA, navigatorDeleteActionOptions.SerializeData)
                .AppendFormButtonIcon(JqGridOptionsNames.Navigator.DELETE_ICON, navigatorDeleteActionOptions.DeleteButtonIcon, JqGridFormButtonIcon.DeleteIcon)
                .AppendFormButtonIcon(JqGridOptionsNames.Navigator.CANCEL_ICON, navigatorDeleteActionOptions.CancelButtonIcon, JqGridFormButtonIcon.CancelIcon);

                if (String.IsNullOrWhiteSpace(fieldName))
                {
                    javaScriptBuilder.AppendJavaScriptObjectClosing();
                }
                else
                {
                    javaScriptBuilder.AppendJavaScriptObjectFieldClosing();
                }
            }
            else if (String.IsNullOrWhiteSpace(fieldName))
            {
                javaScriptBuilder.Append(NULL_NAVIGATOR_OPTIONS);
            }

            return(javaScriptBuilder);
        }