Filter menu hidden inside split pane

Hello,

we are facing a issue using the Grid control inside splitter: the filtering menu is partially hidden when the split pane containing the Grid is lower than the filter popup height (as shown in the following screenshot, I have also attached a sample application).


grid-inside-pane.png


Is there a way to append the filter menu outside the pane (i.e. the body tag) or another way to avoid this behavior?


Thanks in advance.

Best Regards.

Paolo


Attachment: syncfusionsplittergrid_4c160b3.zip

8 Replies 1 reply marked as answer

RR Rajapandi Ravi Syncfusion Team March 16, 2022 02:23 PM UTC

Hi Paolo, 

Greetings from Syncfusion support 

By default, the Grid’s filter dialog has the Grid element set as it targets, so it will only be able to occupy the space within the Grid element. So, it will open inside the splitter pane. This is the default behavior of this case. 

However, you can make the filter dialog to show its full content by customizing its target and position values. This can be done in the Grid’s actionComplete event handler and external CSS as demonstrated in the below code snippet,  

 
actionComplete(args: any) { //actionComplete event of Grid 
    if (args.requestType === "filterafteropen") {   
      // Condition executes after the filter dialog is opened   
      // Retrieve the current filter dialog position    
      var dlgPosition =  args.filterModel.dialogObj.element.getBoundingClientRect();   
      // document body is set as the filter dialog target    
      args.filterModel.dialogObj.target = document.getElementsByTagName("BODY")[0]; 
      // The initially retrieved dialog position is set as the filter dialog positions   
      args.filterModel.dialogObj.position.X = dlgPosition.x; 
      args.filterModel.dialogObj.position.Y = dlgPosition.y;   
      // The filter dialog is refreshed to update the changes   
      args.filterModel.dialogObj.refresh();   
  }   
 

Index.html 
 
<style> 
    .e-checkboxfilter .e-ftrchk, 
.e-checkboxfilter .e-searchbox { 
  padding-left: 9px !important; 
} 
 
.e-ftrchk { 
  padding-bottom: 9px !important; 
  padding-top: 9px !important; 
} 
.e-dialog.e-checkboxfilter { 
  min-height: 322px !important; 
} 
.e-checkboxfilter .e-dlg-content { 
  padding-left: 9px !important; 
} 
.e-dialog.e-checkboxfilter { 
  min-width: 250px !important; 
} 
.e-checkboxfilter .e-searchbox { 
display: block !important; 
} 
.e-checkboxfilter .e-searchclear { 
float: right; 
position: relative; 
} 
 
.e-checkboxfilter .e-checkboxlist { 
height: 200px; 
margin-top: 5px; 
min-height: 160px; 
overflow-y: auto; 
} 
.e-checkboxfilter .e-chk-hidden { 
-moz-appearance: none; 
height: 1px; 
opacity: 0; 
width: 1px; 
} 
.e-checkboxfiltertext { 
  width: 150px; 
  word-break: normal; 
} 
  </style> 
 


Screenshot: 

 

Regards, 
Rajapandi R 



PT Paolo Turello replied to Rajapandi Ravi March 16, 2022 07:52 PM UTC

Hi Rajapandi Ravi,


your solutions worked like a charm!


Thank you for your support.

Best Regards.


Paolo



RR Rajapandi Ravi Syncfusion Team March 17, 2022 04:18 AM UTC

Hi Paolo, 

We are happy to hear that the provided solution was helpful to achieve your requirement. 

Please get back to us if you need further assistance. 

Rajapandi R 



PT Paolo Turello November 17, 2022 03:01 PM UTC

Hello,


going to reopen this support request because our client asked us to have the Excel-like filtering and changing the menu type to Excel doesn't work.

Excel like filter works without the piece of code to move the filter to the body but breaks with the code



We tried also to update syncfusion packages to the latest release but the problem is still there. Any solution to have it working with the Excel filter?

Best regards.

Paolo


Attachment: excelfiltersample_20262c33.zip


PT Paolo Turello November 24, 2022 11:21 AM UTC

Hello,

nothing new about the behavior described above using Excel filters?



RR Rajapandi Ravi Syncfusion Team November 28, 2022 01:23 PM UTC

Paolo,


Based on your query we have modified your shared sample and we have updated the sample to the latest version package version. So we suggest you use the below way to achieve your requirement. Please refer the below code example and sample for more information.


Index.html

 

<style>

#firstgrid .e-filter-popup {

 

position: fixed !important;

 

z-index: 100002 !important;

 

}

</style>

 


app.component.html

 

<ejs-grid id='firstgrid' #grid [dataSource]="data" (actionComplete)="actionComplete($event)" [filterSettings]="defaultFilterSettings" allowFiltering="true" height="100%">

<e-columns>

<e-column field="OrderID" headerText="Order ID" textAlign="Right" width=90></e-column>

<e-column field="CustomerID" headerText="Customer ID" width=120></e-column>

<e-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width=90></e-column>

<e-column field="OrderDate" headerText="Order Date" textAlign="Right" format="yMd" width=120></e-column>

</e-columns>

</ejs-grid>

 

app.component.ts

 

actionComplete(args: any) {

    if (args.requestType === "filterafteropen") {

      this.grid.resetFilterDlgPosition(args.columnName); //pass the column name here

    }

  }


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/sample396672587.zip


Marked as answer

PT Paolo Turello December 12, 2022 02:16 PM UTC

Hello Rajapandi Ravi,

the example works as we expect but for unknown reasons is not working in our app, we're trying to figure out what's wrong and the differences between the two apps.


Thank you again, we appreciate your support!


Best regards.

Paolo




RR Rajapandi Ravi Syncfusion Team December 15, 2022 01:07 PM UTC

Paolo,


Please validate at your end for the issue and get back to us if further assistance needed.


Loader.
Up arrow icon