Hello,
I'm trying to use serverFiltering with Razor, but when I step through my code I can see that Filtering is always Null. Here's my code - can someone see what the issue may be?
@(Html.Kendo().Grid<DAL.ViewModels.Lists.AccountList>()
.Name(
"kendogridvpc"
)
.Columns(columns =>
{
columns.Bound(c => c.FirstName).Width(175);
columns.Bound(c => c.LastName).Width(175);
columns.Bound(c => c.Email);
columns.Bound(c => c.Role).ClientTemplate(
"<i class='fa fa-shield' aria-hidden='true' title='PF: #: PFN #'></i> #: Role #"
).MinScreenWidth(480);
columns.Bound(c => c.Id).Hidden();
columns.Bound(c => c.LatestHPFormId).Hidden();
columns.Bound(c => c.RoleId).Hidden();
columns.Bound(c => c.isClosed).Hidden();
columns.Bound(c => c.IsLockedOut).Hidden();
columns.Bound(c => c.IsApproved).Hidden();
columns.Bound(c => c.IsLatestHPFormOnline).Hidden();
columns.Template(@<text>Hello</text>)
.Title(
"Status"
)
.MinScreenWidth(480)
.Width(120)
.ClientTemplate(
"# if (IsApproved) { #<span class='user-approved'><i class='fa fa-check-circle-o' aria-hidden='true' title='Account Approved'></i></span> # } else { # <span class='user-unapproved'><i class='fa fa-check-circle-o' aria-hidden='true' title='Account Not Approved'></i></span> #}# # if (HPFormHasIssues) {#<span class='user-highlight' title='Highlighted Issues'><i class='fa fa-exclamation-triangle' aria-hidden='true'></i></span>#}# # if (isClosed) {# <span class='user-highlight' title='Account Closed'><i class='fa fa-archive' aria-hidden='true'></i></span> #} else {# #if (IsLockedOut) {#<span class='user-highlight' title='Account Suspended'><i class='fa fa-lock' aria-hidden='true'></i></span> #}# #}#"
);
columns.Command(command => command.Custom(
"Actions"
).HtmlAttributes(
new
{ @
class
=
"btn-primary"
}).Click(
"showMenu"
)).Width(110);
}
)
.Pageable()
.Sortable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu)
.Operators(ops => ops.ForString(str => str.Clear()
.StartsWith(
"Starts with"
)
.IsEqualTo(
"Is equal to"
)
.IsNotEqualTo(
"Is not equal to"
)
.Contains(
"Contains"
)
.DoesNotContain(
"Does not contain"
)
)).Enabled(
true
))
.DataSource(dataSource => dataSource
.Custom()
.Type(
"aspnetmvc-ajax"
)
.PageSize(10)
.ServerPaging(
true
)
.ServerSorting(
true
)
.ServerFiltering(
true
)
.Filter(filters => {
filters.Add<
string
>(f => f.FirstName).IsNotNull();
})
.Schema(schema =>
{
schema.Data(
"Data"
);
schema.Total(
"Total"
);
schema.Model(model =>
{
model.Id(
"Id"
);
model.Field(
"FirstName"
,
typeof
(
string
));
model.Field(
"LastName"
,
typeof
(
string
));
model.Field(
"Email"
,
typeof
(
string
));
model.Field(
"Role"
,
typeof
(
string
));
model.Field(
"RoleId"
,
typeof
(Guid));
model.Field(
"isClosed"
,
typeof
(
bool
));
model.Field(
"IsLockedOut"
,
typeof
(
bool
));
model.Field(
"IsApproved"
,
typeof
(
bool
));
});
})
.Transport(transport =>
{
transport.Read(read => read.Action(
"Users_Read"
,
"User"
).Type(HttpVerbs.Get));
transport.ParameterMap(
"parameterMap"
);
})
)
)