We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

custom multiselect grid filter template blinking

Thread ID:

Created:

Updated:

Platform:

Replies:

144107 Apr 18,2019 03:42 PM UTC Apr 24,2019 05:50 AM UTC Angular - EJ 2 1
loading
Tags: Grid
pk
Asked On April 18, 2019 03:42 PM UTC

Hi I'm Pablo and I'm facing an issue adding a custom filter to a column, using a filter template.
the problem:
when I click con the multiselect, it blinks and fades away (might be related to the tabindex), this is the code:

.html
<ejs-grid #grid [dataSource]='dataGrid | async' [allowPaging]="true" [pageSettings]='pageSettings' [filterSettings]='filterOptions'
          [allowSorting]="true" [allowFiltering]="true" [allowGrouping]="true" height=315 (dataStateChange)='dataStateChange($event)'>
  <e-columns>
    <e-column field='contact' headerText='Contact' textAlign='left' width=150></e-column>
    <e-column field='action' headerText='Action' width=100>
      <ng-template #filterTemplate let-data>
        <ejs-multiselect id='actionsMultiselectFilter' [mode]="actionsSelectMode" [enabled]="true"
                         (change)=onActionMultiselectFilterChange($event) [dataSource]='actionsData' [fields]='actionsFields'
                         [placeholder]="actionsPlaceholder">
        </ejs-multiselect>
      </ng-template>
    </e-column>
    <e-column field='modified' headerText='Mod. Date' textAlign='left' width=120 [allowFiltering]="false"></e-column>
    <e-column field='modifiedBy' hea...
.ts
  @ViewChild('grid')
  public grid: GridComponent;  
  public actionsData: Object[] = [
    { id: '1', action: 'Add' },
    { id: '2', action: 'Modify' },
    { id: '3', action: 'Delete' },
    { id: '9', action: 'Merge record' },
    { id: '10', action: 'Create record' }
  ];
  public actionsFields: Object = { text: 'action', value: 'id' };
  public actionsPlaceholder: string = 'Select actions..';
  public actionsSelectMode : string = 'CheckBox';
  public onActionMultiselectFilterChange(args: any): void {
    this.grid.filterByColumn('action', 'equal', args.value);
  }

I used this as example
(if I press the input and holding move to the dropdown area, it stays and can filter and I get the right filters, thats part is ok )

thanks.

Hariharan J V [Syncfusion]
Replied On April 24, 2019 05:50 AM UTC

Hi Pablo, 

Greeting from Syncfusion. 

We have validated the provided information and we suggest you to use the below way to resolve reported problem. In the below code example, we have bind open and close event for multi select dropdown  and handle the tab index.   

Please find the below code example for more information. 

<ejs-grid #grid [dataSource]='data' allowPaging='true' allowFiltering='true' [pageSettings]="pageOptions"> 
  <e-columns> 
    <e-column field='ProductName' headerText='Product Name' width='150'> 
      <ng-template #filterTemplate let-data> 
        <ejs-multiselect id='actionsMultiselectFilter' #multi [mode]="actionsSelectMode" [enabled]="true" (change)=onActionMultiselectFilterChange($event) 
          [dataSource]='actionsData' [fields]='actionsFields' [placeholder]="actionsPlaceholder" (open)='onOpen($event)' (close)='onClose($event)'> 
        </ejs-multiselect> 
      </ng-template> 
    </e-column> 
  </e-columns> 
</ejs-grid> 


onOpen(e) { 
  if (this.mulObj.element.parentElement.getAttribute('tabindex') === '-1') { 
     this.mulObj.element.parentElement.setAttribute('tabindex', '0'); 
  } 
 
} 
onClose(e){ 
  if (this.mulObj.element.parentElement.getAttribute('tabindex') === '0') { 
      this.mulObj.element.parentElement.setAttribute('tabindex', '-1'); 
      e.cancel = true; 
  } 
} 


Please get back to us if you need further assistance on this. 

Regards, 
Hariharan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon