Name | Surname | Marital status | Employed |
---|---|---|---|
Joe | Crosswave | Married | False |
Merry | Lisel | Widowed | |
Henry | Crux | Single | True |
Cody | Jurut | False | |
Simon | Scranton | Single | |
Leena | Laurent | Divorced | False |
Ode | Cosmides | Married | True |
Diandra | Mizner | Single | False |
Pete | Cassel | Married | False |
Nicky | Tremblay | Married | True |
MvcGrid.Filters.Unregister(typeof(String), "starts-with")
MvcGrid.Filters.Unregister(typeof(String), "ends-with")
@model IQueryable<Person>
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.Name).Titled("Name");
columns.Add(model => model.Surname).Titled("Surname");
columns.Add(model => model.MaritalStatus).Titled("Marital status");
columns.Add(model => model.IsWorking).Titled("Employed");
})
.Empty("No data found")
.Filterable()
)
var CustomTextFilter = (function (base) {
MvcGridExtends(CustomTextFilter, base);
function CustomTextFilter(column) {
base.call(this, column);
this.methods = ['contains', 'equals', 'not-equals'];
}
return CustomTextFilter;
})(MvcGridTextFilter);
new MvcGrid(document.querySelector('.mvc-grid'), {
filters: {
'text': CustomTextFilter
}
});