Example #1
0
 internal static bool AreDefault(this JqGridNavigatorViewActionOptions navigatorViewActionOptions)
 {
     return((navigatorViewActionOptions.Width == JqGridOptionsDefaults.Navigator.ViewActionWidth) &&
            (navigatorViewActionOptions.LabelsWidth == JqGridOptionsDefaults.Navigator.LabelsWidth) &&
            (navigatorViewActionOptions.ViewPagerButtons == JqGridOptionsDefaults.Navigator.ViewPagerButtons) &&
            (navigatorViewActionOptions.RecreateForm == JqGridOptionsDefaults.Navigator.RecreateForm) &&
            ((navigatorViewActionOptions.NavigationKeys == null) || navigatorViewActionOptions.NavigationKeys.IsDefault()) &&
            ((navigatorViewActionOptions.CloseButtonIcon == null) || navigatorViewActionOptions.CloseButtonIcon.Equals(JqGridFormButtonIcon.CloseIcon)) &&
            (navigatorViewActionOptions as JqGridNavigatorFormActionOptions).AreDefault());
 }
        private static StringBuilder AppendNavigatorViewActionOptions(this StringBuilder javaScriptBuilder, JqGridNavigatorViewActionOptions navigatorViewActionOptions)
        {
            if ((navigatorViewActionOptions != null) && !navigatorViewActionOptions.AreDefault())
            {
                javaScriptBuilder.Append(",")
                .AppendJavaScriptObjectOpening()
                .AppendNavigatorFormActionOptions(navigatorViewActionOptions)
                .AppendJavaScriptObjectIntegerField(JqGridOptionsNames.Navigator.WIDTH, navigatorViewActionOptions.Width, JqGridOptionsDefaults.Navigator.ViewActionWidth)
                .AppendJavaScriptObjectStringField(JqGridOptionsNames.Navigator.LABELS_WIDTH, navigatorViewActionOptions.LabelsWidth, JqGridOptionsDefaults.Navigator.LabelsWidth)
                .AppendFormButtonIcon(JqGridOptionsNames.Navigator.CLOSE_ICON, navigatorViewActionOptions.CloseButtonIcon, JqGridFormButtonIcon.CloseIcon)
                .AppendNavigatorPageableFormActionOptions(navigatorViewActionOptions)
                .AppendJavaScriptObjectClosing();
            }
            else
            {
                javaScriptBuilder.Append(NULL_NAVIGATOR_OPTIONS);
            }

            return(javaScriptBuilder);
        }