Skip to content

Commit 402e008

Browse files
committed
Update DataTableConfigVm.cs
1 parent 2e71882 commit 402e008

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Mvc.JQuery.Datatables/DataTableConfigVm.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ public TTarget Select(params string[] options)
134134
{
135135
_colDef.Filter.type = "select";
136136
_colDef.Filter.values = options.Cast<object>().ToArray();
137+
if (_colDef.Type.IsEnum)
138+
{
139+
_colDef.Filter.values = _colDef.Type.EnumValLabPairs();
140+
}
137141
return _target;
138142
}
139143
public TTarget NumberRange()
@@ -158,6 +162,10 @@ public TTarget CheckBoxes(params string[] options)
158162
{
159163
_colDef.Filter.type = "checkbox";
160164
_colDef.Filter.values = options.Cast<object>().ToArray();
165+
if (_colDef.Type.IsEnum)
166+
{
167+
_colDef.Filter.values = _colDef.Type.EnumValLabPairs();
168+
}
161169
return _target;
162170
}
163171

@@ -294,4 +302,4 @@ private static IDictionary<string, object> ConvertObjectToDictionary(object obj)
294302
return new Dictionary<string, object>(new RouteValueDictionary(obj));
295303
}
296304
}
297-
}
305+
}

0 commit comments

Comments
 (0)