Hi,
I have a grid with a remote datasource.
When i click filter it applies the filter to the grid and shows the correct data.
When i click "clear" nothing happens, it does not trigger a refresh ?
serverfiltering is set to false on the datasource if that means anything.
code:
datasource:
function
setDatasource() {
_dataSource =
new
kendo.data.HierarchicalDataSource({
transport: {
read: {
url: _crudServiceBaseUrl +
"/api/grid/"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
,
headers: {
"RequestVerificationToken"
: _tokenHeaderValue
}
},
destroy: {
url:
function
(dataItem) {
return
_crudServiceBaseUrl +
"/api/grid/"
},
type:
"DELETE"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
,
headers: {
"RequestVerificationToken"
: _tokenHeaderValue
}
},
parameterMap:
function
(data, operation) {
if
(operation !==
"read"
) {
return
JSON.stringify(data);
}
else
{
var
itemId = (data.ItemId ? data.ItemId :
null
);
return
{
ContactId: _contactId,
ProjectId: _projectId,
SaleId: _saleId,
ItemId: (itemId === parseInt(_rootFolderId) ?
null
: itemId)
};
}
}
},
schema: {
model: {
id:
"ItemId"
,
fields: {
ItemId: { type:
"number"
, nullable:
false
, editable:
false
},
ParentId: { type:
"number"
, nullable:
true
, editable:
true
},
IsGroup: { type:
"boolean"
, nullable:
false
, editable:
true
},
AppointmentId: { type:
"number"
, nullable:
true
, editable:
false
},
DocumentId: { type:
"number"
, nullable:
true
, editable:
false
},
Company: { type:
"string"
, nullable:
true
, editable:
false
},
Contact: { type:
"string"
, nullable:
true
, editable:
false
},
Associate: { type:
"string"
, nullable:
true
, editable:
false
},
Registered: { type:
"date"
, editable:
false
},
Type: { type:
"string"
, nullable:
true
, editable:
false
},
Text: { type:
"string"
, validation: { required:
true
} },
IsCompleted: { type:
"boolean"
, editable:
false
},
ContactId: { type:
"number"
, nullable:
true
, editable:
true
},
ProjectId: { type:
"number"
, nullable:
true
, editable:
true
},
SaleId: { type:
"number"
, nullable:
true
, editable:
true
}
}
}
},
serverPaging:
false
,
serverFiltering:
false
,
serverSorting:
false
,
sort: [
{ field:
"Registered"
, dir:
"desc"
},
{ field:
"Text"
, dir:
"asc"
}
],
filter: {
logic:
"and"
,
filters: getGridFilters()
}
});
}
grid:
function
initGrid() {
$grid.kendoGrid({
dataSource: _dataSource,
filterable:
true
,
sortable:
true
,
pageable:
false
,
resizable:
true
,
height: getWindowHeight(),
editable: {
mode:
"popup"
,
confirmation:
false
},
noRecords: {
template: $Resources$.GridNoData
},
columns: [
{
title:
"Folder"
,
headerTemplate:
"<span class=\"far fa-folder\" style=\"padding-right: 7px;\"></span><span id=\"breadcrumbText\"></span><span class=\"float-right\"><label class=\"checkboxHeader\" style=\"padding-right: 7px;\"><input type=\"checkbox\" id=\"toggleDocuments\" name=\"toggleDocuments\""
+ getToggleDocuments() +
"> "
+ $Resources$.CheckboxDocuments +
"</label><label class=\"checkboxHeader\"><input type=\"checkbox\" id=\"toggleAppointments\" name=\"toggleAppointments\""
+ getToggleAppointments() +
"> "
+ $Resources$.CheckboxAppointments +
"</label></span>"
,
columns:
[{
field:
"IsCompleted"
,
headerTemplate:
"<span class=\"fas fa-check\" aria-hidden=\"true\"></span>"
,
template: $(
"#checkboxtemplate"
).html(),
width: 34,
filterable:
false
,
sortable:
false
},
{
field:
"Type"
,
template: $(
"#categorytemplate"
).html(),
headerTemplate:
""
,
width: 34,
filterable:
false
,
sortable:
false
,
},
{ field:
"Registered"
, template: $(
"#registeredtemplate"
).html(), headerTemplate:
"Date"
, width: 110 },
{ field:
"Type"
, headerTemplate:
"Type"
, width: 150 },
{ field:
"Text"
, template: $(
"#texttemplate"
).html() },
{ field:
"Contact"
},
{ field:
"Associate"
, headerTemplate:
"Associate"
, width: 150 }]
}
],
dataBound:
function
(e) {
}
});
}