Filtering SignalR datasource

4 posts, 1 answers
  1. Jon
    Jon avatar
    53 posts
    Member since:
    Oct 2013

    Posted 20 Jun Link to this post

    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.

  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 22 Jun Link to this post

    Hi Jon,

    From the provided information it's not clear for us what is the exact reason for current behavior. Could you please provide runable (and isolated) example where the issue is reproduced? This would help me advice you better how to proceed. 

    Regards,
    Vladimir Iliev
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Jon
    Jon avatar
    53 posts
    Member since:
    Oct 2013

    Posted 22 Jun in reply to Vladimir Iliev Link to this post

    Hi, have raised support ticket 1045379 with copy of application and data.
  5. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 23 Jun Link to this post

    Hi Jon,

    I answered to this query in the duplicated support ticket created by you - #1045379 . Please keep in mind that it is highly recommended that you keep related questions in one support thread or a forum post, so that we can easily keep track of your support history and provide better answers in a shorter time.

    Regards,
    Vladimir Iliev
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready