Skip to content

Commit 198a157

Browse files
committed
draw parameter fixed on the server side
1 parent 05c0ee1 commit 198a157

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/JQDT/ModelBinders/FormModelBinder.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class FormModelBinder : IFormModelBinder
2222
private const string CustomFiltersPatternFormKey = @"^custom\[filters\]\[(.+)\]\[(gte|gt|lte|lt|eq)\]$";
2323
private const string ColumnsOrderableFormKey = "columns[{0}][orderable]";
2424
private const string ColumnsSearchableFormKey = "columns[{0}][searchable]";
25+
private const string DrawFormKey = "draw";
2526

2627
private const string ColumnsFormKeyPattern = @"^columns\[(\d+)\]\[data\]$";
2728
private const string ColumnsSearchValueFormKeyPattern = "columns[{0}][search][value]";
@@ -77,7 +78,8 @@ public RequestInfoModel BindModel<T>(NameValueCollection ajaxForm, T data)
7778
},
7879
Order = this.GetOrderList(),
7980
Columns = this.GetColumns(),
80-
Custom = this.GetCustom()
81+
Custom = this.GetCustom(),
82+
Draw = this.GetDraw()
8183
};
8284

8385
var requestInfoModel = new RequestInfoModel
@@ -93,6 +95,15 @@ public RequestInfoModel BindModel<T>(NameValueCollection ajaxForm, T data)
9395
return requestInfoModel;
9496
}
9597

98+
private int GetDraw()
99+
{
100+
string drawAsString;
101+
this.ajaxFormDictionary.TryGetValue(DrawFormKey, out drawAsString);
102+
var draw = int.Parse(drawAsString);
103+
104+
return draw;
105+
}
106+
96107
private Type GetModelType(object data)
97108
{
98109
var dataType = data.GetType();

0 commit comments

Comments
 (0)