AnsweredAssumed Answered

My Filter don t work in my drawer

Question asked by akram zouggari on Mar 22, 2018
Latest reply on Mar 27, 2018 by David López

Hi everyone, 

My Filter don t work in my drawer,

the drawer it s working but not the filter 

render: function(options) {
    this._super('render', [options]);
    var url_string = window.location.href;
    var phone = url_string.split('=')[1];
    console.log(phone);

    if(phone){
        //create filter
        var filterOptions = new app.utils.FilterOptions()
            .config({
                'initial_filter': 'FilterPhone',
                'initial_filter_label': 'FilterPhone',
                'filter_populate': {
                    'phone_home': phone,
                    'phone_mobile': phone,
                    'phone_work ': phone,
                    'phone_other': phone,
                    'phone_fax': phone
                }
            })
            .format();

         //open drawer
        app.drawer.open({
            layout: 'list',
            context: {
                module: 'Contacts',
                filterOptions: filterOptions,
                parent: this.context
            }
        });

    }

 

 

My php file 

/**
* Created by PhpStorm.
* User: Akram Zouggari
* Date: 2018-03-22
* Time: 8:50 AM
*/

$viewdefs['Contacts']['base']['filter']['basic']['filters'][] = array(
    'id' => 'FilterPhone',
    'name' => 'FilterPhone',
    'filter_definition' => array(
        '$or' => array(
            array(
                'phone_work' => array(
                    '$equals' => '',
                ),
            ),
            array(
                'phone_fax' => array(
                    '$equals' => '',
                ),
            array(
                 'phone_home' => array(
                        '$equals' => '',
                 ),
            ),
        ),
    ),
    'editable' => true,
    'is_template' => true,
));

Thank s 

Outcomes