@@ -29,19 +29,23 @@ public DataTableConfigVm(string id, string ajaxUrl, IEnumerable<ColDef> columns)
29
29
AjaxUrl = ajaxUrl ;
30
30
this . Id = id ;
31
31
this . Columns = columns ;
32
- this . ShowSearch = true ;
32
+ this . Filter = true ;
33
+
33
34
this . ShowPageSizes = true ;
34
35
this . TableTools = true ;
35
36
ColumnFilterVm = new ColumnFilterSettingsVm ( this ) ;
36
37
AjaxErrorHandler =
37
38
"function(jqXHR, textStatus, errorThrown)" +
38
39
"{ " +
39
- "window.alert ('error loading data: ' + textStatus + ' - ' + errorThrown); " +
40
+ "console.log ('error loading data: ' + textStatus + ' - ' + errorThrown); " +
40
41
"console.log(arguments);" +
41
42
"}" ;
42
43
}
43
44
44
- public bool ShowSearch { get ; set ; }
45
+ /// <summary>
46
+ /// Sets the bFilter properyt
47
+ /// </summary>
48
+ public bool Filter { get ; set ; }
45
49
46
50
public string Id { get ; private set ; }
47
51
@@ -90,20 +94,36 @@ public string Dom
90
94
return _dom ;
91
95
92
96
string str = "" ;
93
- if ( this . ColVis )
97
+ if ( this . ShowVisibleColumnPicker )
94
98
str += "C" ;
95
99
if ( this . TableTools )
96
100
str += "T<\" clear\" >" ;
97
101
if ( this . ShowPageSizes )
98
102
str += "l" ;
99
- if ( this . ShowSearch )
103
+ if ( this . ShowFilterInput )
100
104
str += "f" ;
101
105
return str + "tipr" ;
102
106
}
103
107
104
108
set { _dom = value ; }
105
109
}
106
110
111
+
112
+ public bool ShowVisibleColumnPicker { get ; set ; }
113
+
114
+ public bool ShowFilterInput { get ; set ; }
115
+
116
+ [ Obsolete ( "Use .Filter and .ShowFilterInput" ) ]
117
+ public bool ShowSearch
118
+ {
119
+ get { return ShowFilterInput && Filter ; }
120
+ set
121
+ {
122
+ ShowFilterInput = value ;
123
+ Filter = value ;
124
+ }
125
+ }
126
+
107
127
public bool ColVis { get ; set ; }
108
128
109
129
public string ColumnSortingString
@@ -202,9 +222,9 @@ public _FilterOn<DataTableConfigVm> FilterOn<T>(object jsOptions)
202
222
IDictionary < string , object > optionsDict = DataTableConfigVm . ConvertObjectToDictionary ( jsOptions ) ;
203
223
return FilterOn < T > ( optionsDict ) ;
204
224
}
205
- ////public _FilterOn<DataTableConfigVm> FilterOn<T>(IDictionary<string, object> jsOptions )
225
+ ////public _FilterOn<DataTableConfigVm> FilterOn<T>(IDictionary<string, object> filterOptions )
206
226
////{
207
- //// return new _FilterOn<DataTableConfigVm>(this, this.FilterTypeRules, (c, t) => t == typeof(T), jsOptions );
227
+ //// return new _FilterOn<DataTableConfigVm>(this, this.FilterTypeRules, (c, t) => t == typeof(T), filterOptions );
208
228
////}
209
229
public _FilterOn < DataTableConfigVm > FilterOn ( string columnName )
210
230
{
@@ -221,16 +241,16 @@ public _FilterOn<DataTableConfigVm> FilterOn(string columnName, object jsOptions
221
241
IDictionary < string , object > initialSearchColsDict = ConvertObjectToDictionary ( jsInitialSearchCols ) ;
222
242
return FilterOn ( columnName , optionsDict , initialSearchColsDict ) ;
223
243
}
224
- public _FilterOn < DataTableConfigVm > FilterOn ( string columnName , IDictionary < string , object > jsOptions )
244
+ public _FilterOn < DataTableConfigVm > FilterOn ( string columnName , IDictionary < string , object > filterOptions )
225
245
{
226
- return FilterOn ( columnName , jsOptions , null ) ;
246
+ return FilterOn ( columnName , filterOptions , null ) ;
227
247
}
228
- public _FilterOn < DataTableConfigVm > FilterOn ( string columnName , IDictionary < string , object > jsOptions , IDictionary < string , object > jsInitialSearchCols )
248
+ public _FilterOn < DataTableConfigVm > FilterOn ( string columnName , IDictionary < string , object > filterOptions , IDictionary < string , object > jsInitialSearchCols )
229
249
{
230
250
var colDef = this . Columns . Single ( c => c . Name == columnName ) ;
231
- if ( jsOptions != null )
251
+ if ( filterOptions != null )
232
252
{
233
- foreach ( var jsOption in jsOptions )
253
+ foreach ( var jsOption in filterOptions )
234
254
{
235
255
colDef . Filter [ jsOption . Key ] = jsOption . Value ;
236
256
}
0 commit comments