Hi I have a scheduler that I'm trying to apply dynamic filtering. From my research I found out about parameterMap... I have implemented it as follows...
In my Scheduler initialisation....
dataSource: {
type: "signalr",
push: function (e) {
generateNotification(e.type, e.items[0].WRequestID, e.items[0].diary, e.items[0].team);
},
transport: {
signalr: {
hub: sHub,
promise: sHubStart,
ParameterMap: "parameterMap",
server: {
read: "read",
create: "create",
update: "update",
destroy: "destroy"
},
client: {
read: "read",
create: "create",
update: "update",
destroy: "destroy"
}
}
},
schema: {
model: {
id: "WRequestID",
fields: {
WRequestID: {
type: "number",
editable: false,
defaultValue: -1
},
start: {
from: "Start",
type: "date",
culture: "en-GB"
},
end : {
from: "End",
type: "date",
culture: "en-GB"
},
diary: {
from: "Diary",
type: "string",
defaultValue: "@AppShort"
},
team: {
from: "Team",
type: "string",
validation: { required: true }
},
title: {
from: "Title",
type: "string",
validation: { required: true }
},
workManager: {
from: "WorkManagerID",
type: "number",
validation: { required: true }
},
assignee: {
from: "AssigneeID",
type: "number",
validation: { required: true }
},
changeRef: {
from: "ChangeRef",
type: "string",
validation: { required: true }
},
description: {
from: "Description",
type: "string",
validation: { required: true }
},
impactedServers: {
from: "ImpactedServers",
type: "string",
validation: { required: true }
},
impactedServices: {
from: "ImpactedServices",
type: "string",
validation: { required: true }
},
isBAU: {
from: "IsBAU",
type: "boolean",
defaultValue: false
},
projectRef: {
from: "ProjectRef",
type: "string",
validation: { required: true }
},
notes: {
from: "Notes",
type: "string"
},
isOOH: {
from: "IsOOH",
type: "boolean",
defaultValue: false
},
isAllDay: {
from: "IsAllDay",
type: "boolean",
defaultValue: false
},
recurrenceRule: {
from: "RecurrenceRule",
type: "string"
},
recurrenceId: {
from: "RecurrenceID",
type: "number"
},
recurrenceException: {
from: "RecurrenceException",
type: "string"
},
startTimezone: {
from: "StartTimezone",
type: "string"
},
endTimezone: {
from: "EndTimezone",
type: "string"
},
requestStatus: {
from: "RequestStatus",
type: "number",
defaultValue: 0
}
}
}
And my parametermap code is:
function parameterMap(data, type) {
alert(type);
if (type === "read") {
data.filter = { logic: "and", filters: [{ field: "diary", operator: "eq", value: '@AppShort' }] };
}
return data;
}
Where @AppShort is a value that has been derived at the beginning of the view...
@Code
ViewData("Title") = "Home Page"
Dim AppShort As String
AppShort = SupportDiary.My.MySettings.Default.AppShort
End Code
Unfortunately the filtering does not work... I get no errors... the scheduler just shows all scheduled events without filtering.