Our flexible Kanban board for managing tasks with drag drop


Post by shimnx »

  tbar: [
        { type: 'taskfilterfield', placeholder: 'FILTER TASKS' },
        // Field for filtering columns
        // { type : 'columnfilterfield' },
        // Field for filtering swimlanes
        // { type: 'swimlanepickerbutton', text: 'Group', placeholder: 'MEMBER', },
        // {
        //     type: 'textfield',
        //     placeholder: 'Group',
        //     lable:'Group',
        //     icon: 'b-fa b-fa-filter',
        //     clearable: true,
        //     onChange({value}) {
        //         console.log(value)
        //         window['ProjectTaskComponent'].component.taskboard.project.eventStore.filter({
        //             id       : 'eventNameFilter',
        //             filterBy : event => {
        //                 return event.groupName.match(new RegExp(value, 'i'))
        //             }
        //         });
        //     },

    // },
    // Move the last items to the right
    {
        type: 'textfield',
        placeholder: 'MEMBER',
        lable: 'Member',
        icon: 'b-fa b-fa-filter',
        clearable: true,
        onChange({ value }) {
          
            console.log(value)
            window['ProjectTaskComponent'].component.taskboard.project.eventStore.filter({
                id: 'eventNameFilter',
                filterBy: event => {
                    return event.assigner.match(new RegExp(value, 'i'))
                }
            });

        },
     
    },
    {
        type: 'Combo',
        placeholder: 'PRIORITY',
        icon: 'b-fa b-fa-filter',
        items: ['Low', 'Medium', 'High'],
        clearable: true,
        onChange({ value }) {
            console.log(value)

            window['ProjectTaskComponent'].component.taskboard.project.eventStore.filter({
                id: 'eventNameFilter',
                filterBy: event => {
                    console.log(event.prio)
                    if (event.prio) {
                        if (value) {
                            return event.prio.match(new RegExp(value, 'i'))
                        } else {
                            return true
                        }

                    }
                }
            });
        },

    },
    {
        type: 'date',
        placeholder: 'START DATE',
        icon: 'b-fa b-fa-filter',
        clearable: true,
        onChange({ value }) {
            console.log(value)
            window['ProjectTaskComponent'].component.taskboard.project.eventStore.filter({
                id: 'eventNameFilter',
                filterBy: event => {
                    console.log(event.date)
                    if(event.date){
                        if (value) {
                            return moment(event.date).diff(moment(value), 'days') >= 0
                        } else {
                            return true
                        }
                    }

                }
            });
     
        },

    },
    {
        type: 'date',
        placeholder: 'END DATE',
        icon: 'b-fa b-fa-filter',
        clearable: true,
        onChange({ value }) {
            console.log(value)
            window['ProjectTaskComponent'].component.taskboard.project.eventStore.filter({
                id: 'eventNameFilter',
                filterBy: event => {
                    console.log(event.date)
                    if(event.date){
                        if (value) {
                            return moment(event.date).diff(moment(value), 'days') <= 0
                        } else {
                            return true
                        }
                    }

                }
            });
         
        },

    }
    // Button to pick which columns are shown
    // { type : 'columnpickerbutton' },
    // Button to pick which swimlanes are shown
    // { type : 'swimlanepickerbutton' }
],

There is a problem with the filtering of my start time and end time. Every time I modify the start time or end time, it will filter from all task cards without considering other filtering conditions

Attachments
Media1.mp4
(1.34 MiB) Downloaded 13 times

Post by alex.l »

You used same filter id for all actions. So you basically replaced previous applied filter to a new one.

All the best,
Alex


Post Reply