@@ -17,19 +17,19 @@ public static ColDef Create(string name, string p1, Type propertyType)
1717 return new ColDef ( ) { Name = name , DisplayName = p1 , Type = propertyType } ;
1818 }
1919 }
20- public class DataTableVm
20+ public class DataTableConfigVm
2121 {
2222 IDictionary < string , object > m_JsOptions = new Dictionary < string , object > ( ) ;
2323
24- static DataTableVm ( )
24+ static DataTableConfigVm ( )
2525 {
2626 DefaultTableClass = "table table-bordered table-striped" ;
2727 }
2828
2929 public static string DefaultTableClass { get ; set ; }
3030 public string TableClass { get ; set ; }
3131
32- public DataTableVm ( string id , string ajaxUrl , IEnumerable < ColDef > columns )
32+ public DataTableConfigVm ( string id , string ajaxUrl , IEnumerable < ColDef > columns )
3333 {
3434 AjaxUrl = ajaxUrl ;
3535 this . Id = id ;
@@ -101,6 +101,7 @@ public string GetFilterType(string columnName, Type type)
101101 {
102102 ( c , t ) => ( DateTypes . Contains ( t ) ) ? "{type: 'date-range'}" : null ,
103103 ( c , t ) => t == typeof ( bool ) ? "{type: 'checkbox', values : ['True', 'False']}" : null ,
104+ ( c , t ) => t == typeof ( bool ? ) ? "{type: 'checkbox', values : ['True', 'False', 'null']}" : null ,
104105 ( c , t ) => t . IsEnum ? ( "{type: 'checkbox', values : ['" + string . Join ( "','" , Enum . GetNames ( t ) ) + "']}" ) : null ,
105106 ( c , t ) => "{type: 'text'}" , //by default, text filter on everything
106107 } ;
@@ -169,37 +170,37 @@ private void AddRule(string result)
169170 {
170171 if ( result != "null" && this . _jsOptions != null && this . _jsOptions . Count > 0 )
171172 {
172- var _jsOptionsAsJson = DataTableVm . convertDictionaryToJsonBody ( this . _jsOptions ) ;
173+ var _jsOptionsAsJson = DataTableConfigVm . convertDictionaryToJsonBody ( this . _jsOptions ) ;
173174 result = result . TrimEnd ( '}' ) + ", " + _jsOptionsAsJson + "}" ;
174175 }
175176 _list . Insert ( 0 , ( c , t ) => _predicate ( c , t ) ? result : null ) ;
176177 }
177178 }
178- public _FilterOn < DataTableVm > FilterOn < T > ( )
179+ public _FilterOn < DataTableConfigVm > FilterOn < T > ( )
179180 {
180181 return FilterOn < T > ( null ) ;
181182 }
182- public _FilterOn < DataTableVm > FilterOn < T > ( object jsOptions )
183+ public _FilterOn < DataTableConfigVm > FilterOn < T > ( object jsOptions )
183184 {
184- IDictionary < string , object > optionsDict = DataTableVm . convertObjectToDictionary ( jsOptions ) ;
185+ IDictionary < string , object > optionsDict = DataTableConfigVm . convertObjectToDictionary ( jsOptions ) ;
185186 return FilterOn < T > ( optionsDict ) ;
186187 }
187- public _FilterOn < DataTableVm > FilterOn < T > ( IDictionary < string , object > jsOptions )
188+ public _FilterOn < DataTableConfigVm > FilterOn < T > ( IDictionary < string , object > jsOptions )
188189 {
189- return new _FilterOn < DataTableVm > ( this , this . FilterTypeRules , ( c , t ) => t == typeof ( T ) , jsOptions ) ;
190+ return new _FilterOn < DataTableConfigVm > ( this , this . FilterTypeRules , ( c , t ) => t == typeof ( T ) , jsOptions ) ;
190191 }
191- public _FilterOn < DataTableVm > FilterOn ( string columnName )
192+ public _FilterOn < DataTableConfigVm > FilterOn ( string columnName )
192193 {
193194 return FilterOn ( columnName , null ) ;
194195 }
195- public _FilterOn < DataTableVm > FilterOn ( string columnName , object jsOptions )
196+ public _FilterOn < DataTableConfigVm > FilterOn ( string columnName , object jsOptions )
196197 {
197- IDictionary < string , object > optionsDict = DataTableVm . convertObjectToDictionary ( jsOptions ) ;
198+ IDictionary < string , object > optionsDict = DataTableConfigVm . convertObjectToDictionary ( jsOptions ) ;
198199 return FilterOn ( columnName , optionsDict ) ;
199200 }
200- public _FilterOn < DataTableVm > FilterOn ( string columnName , IDictionary < string , object > jsOptions )
201+ public _FilterOn < DataTableConfigVm > FilterOn ( string columnName , IDictionary < string , object > jsOptions )
201202 {
202- return new _FilterOn < DataTableVm > ( this , this . FilterTypeRules , ( c , t ) => c == columnName , jsOptions ) ;
203+ return new _FilterOn < DataTableConfigVm > ( this , this . FilterTypeRules , ( c , t ) => c == columnName , jsOptions ) ;
203204 }
204205
205206 private static string convertDictionaryToJsonBody ( IDictionary < string , object > dict )
0 commit comments