Hi,
When the user does click on cell I have to obtain the names of rows.
Using the method drillThrough I have args.rowHeaders but it's not the same of list of rows (it's a label).
Example:
let dataSourceSettings = { enableSorting: true, columns: [{ name: 'Year' }, { name: 'Quarter' }], valueSortSettings: { headerDelimiter: ' - ' }, values: [{ name: 'Sold', caption: 'Units Sold' }, { name: 'Amount', caption: 'Sold Amount' }], dataSource: getPivotData(), rows: [{ name: 'Country' }, { name: 'Products' }], formatSettings: [{ name: 'Amount', format: 'C0' }], expandAll: false, filters: [] };
- The user does click on the cell Germany -> Montain Bikes the result would be: ['Country','Products'].
- The user does click on the cell Germany the result would be: ['Country'].
- If the user rearrange the rows to Products -> Country and the user does click on the cell Mountain Bikes => Germany then :['Products','Country'].
Is there any way to do this ?.
Thanks in advance !.
Jorge
|
export class DrillThroughComponent extends SampleBase {
render() {
return (
<div className="control-pane">
<div className="control-section" style={{ overflow: 'initial' }}>
<PivotViewComponent
id="PivotView" ref={pivotview => {pivotObj = pivotview;}} dataSourceSettings={dataSourceSettings}
showTooltip={false} width={'100%'} height={'300'} showFieldList={true}
allowDrillThrough={true} gridSettings={{ columnWidth: 140 }}
drillThrough={this.drillThrough.bind(this)}>
<Inject services={[FieldList, DrillThrough]} />
</PivotViewComponent>
</div>
</div>
);
}
drillThrough(args) {
let rows = [];
let headers = args.rowHeaders.split(dataSourceSettings.valueSortSettings.headerDelimiter);
for(let header of headers) {
for(let field of dataSourceSettings.rows){
if (pivotObj.engineModule.fieldList[field.name] && pivotObj.engineModule.fieldList[field.name].members[header]) {
rows.push(field.name); /// here you can get the selected rows.
break;
}
}
}
}
}
|
Hi,
It works, I can retrieve the list of fields rows of the clicked cell.
Thank you !.
Jorge