Adding Dynamic DropDownList to Div on PivotView Field Drag

I'm using PivotView as shown below:

<div fxLayout='column'>
  <div fxLayout='row' #dynamicFilter id='dynamicFilter' style="background-color: bisque; padding: 2px;height: auto;  min-height: 35px;">
  </div>
  <ejs-pivotview #pivotview id='PivotView' height='500' showGroupingBar='true' allowCalculatedField='true'
    allowDrillThrough='true' (drillThrough)="editCell($event)" (created)='created()' [showFieldList]='false'
    [showTooltip]='false' [dataSourceSettings]='dataSourceSettings' (dataBound)='dataBound($event)'
    [gridSettings]='gridSettings' allowConditionalFormatting='true' (onFieldDropped)='fieldDropped($event)'>
  </ejs-pivotview>
</div>

I want to add dynamic DropDownList controls to DIV element on Field Drag event (onFieldDropped) of the PivotView control.
1] DropDownList controls should add to DIV only when Fields are dropped on COLUMN AREA of the PivotView.
2] Also, added DropDownList should be removed from the DIV when fields are moved back from Column Area to Filter Area.

How to do this?

fieldDropped(args: FieldDroppedEventArgs): void { 
let dynamicFilter = document.getElementById("dynamicFilter");
    let dropdown = new DropDownList({
      dataSource: [],
      fields: { value: 'id', text: 'text' },
      placeholder: '--Select--',
      width: '200px',
      floatLabelType: 'Never'
    });
}

5 Replies 1 reply marked as answer

SN Sivamathi Natarajan Syncfusion Team September 18, 2020 03:11 PM UTC

 
Thanks for contacting Syncfusion support. 
 
Based on your requirement we have prepared a sample for your reference. It can achieved by using fieldDrop event. Please check the below sample link. 
 
 
We hope the above sample meets your requirements. 
 
Regards, 
Sivamathi. 


Marked as answer

SH Shreekumar September 18, 2020 06:19 PM UTC

Hi Team


This is working as expected. The only issue is, if I add more filters to Column Area, dropdownlist controls will be added one above another.

Might be appending action is the issue.


SN Sivamathi Natarajan Syncfusion Team September 21, 2020 08:04 AM UTC

Hi ShreeKumar, 
 
We suspect that your requirement is to add the fields in the drop-down list while dropping fields in column axis (or) your requirement is to create a new drop down list for every fields which is added in column axis. So, we have modified the sample as per your requirement. 
 
 
We hope the above sample meets your requirements.  
 
Regards, 
Sivamathi. 



SH Shreekumar September 21, 2020 09:12 AM UTC

The requirement is to create a new drop down list for every field which is added in column axis. 
And remove dropdown when the field is removed from the column axis.


SN Sivamathi Natarajan Syncfusion Team September 22, 2020 11:38 AM UTC

 
We have modified the sample based on your requirement. Kindly get the same in the following link. 
 
 
Please let us know if you have concern. 
 
Regards, 
Sivamathi. 


Loader.
Up arrow icon