Skip to content

Commit

Permalink
Lib.Web.Mvc - Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tpeczek committed Mar 25, 2011
1 parent 9595571 commit 4bdfdb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public JqGridColumnEditableAttribute(bool editable)
EditOptions = new JqGridColumnEditOptions();
EditRules = new JqGridColumnEditRules();
EditType = JqGridColumnEditTypes.Text;
FormOptions = new JqGridColumnFormOptions();
}

/// <summary>
Expand Down
6 changes: 4 additions & 2 deletions Lib.Web.Mvc/JQuery/JqGrid/JqGridColumnModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ internal JqGridColumnModel(ModelMetadata propertyMetadata)
Sortable = columnSortableAttribute.Sortable;
Index = columnSortableAttribute.Index;
}
else
Index = propertyMetadata.PropertyName;

JqGridColumnSearchableAttribute columnSearchableAttribute = customAttributes.OfType<JqGridColumnSearchableAttribute>().FirstOrDefault();
if (columnSearchableAttribute != null)
Expand All @@ -191,6 +189,7 @@ internal JqGridColumnModel(ModelMetadata propertyMetadata)
EditOptions = columnEditableAttribute.EditOptions;
EditRules = columnEditableAttribute.EditRules;
EditType = columnEditableAttribute.EditType;
FormOptions = columnEditableAttribute.FormOptions;

if ((propertyMetadata.ModelType == typeof(Int16)) || (propertyMetadata.ModelType == typeof(Int32)) || (propertyMetadata.ModelType == typeof(Int64)) || (propertyMetadata.ModelType == typeof(UInt16)) || (propertyMetadata.ModelType == typeof(UInt32)) || (propertyMetadata.ModelType == typeof(UInt32)))
EditRules.Integer = true;
Expand Down Expand Up @@ -219,6 +218,9 @@ internal JqGridColumnModel(ModelMetadata propertyMetadata)

Name = propertyMetadata.PropertyName;

if (String.IsNullOrWhiteSpace(Index))
Index = propertyMetadata.PropertyName;

if (!String.IsNullOrWhiteSpace(propertyMetadata.TemplateHint) && propertyMetadata.TemplateHint.Equals("HiddenInput"))
Hidden = true;
else
Expand Down
2 changes: 1 addition & 1 deletion Lib.Web.Mvc/JQuery/JqGrid/JqGridHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ private static void AppendNavigatorActionOptions(JqGridNavigatorActionOptions ac
javaScriptBuilder.AppendFormat("modal: {0},", actionOptions.Modal.Value.ToString().ToLower());

if (actionOptions.MethodType.HasValue)
javaScriptBuilder.AppendFormat("mtype: {0},", actionOptions.MethodType.Value.ToString().ToUpper());
javaScriptBuilder.AppendFormat("mtype: '{0}',", actionOptions.MethodType.Value.ToString().ToUpper());

if (!String.IsNullOrWhiteSpace(actionOptions.OnClose))
javaScriptBuilder.AppendFormat("onClose: '{0}',", actionOptions.OnClose);
Expand Down

0 comments on commit 4bdfdb0

Please sign in to comment.