jQWidgets Forums

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts

  • weibao
    Participant

    I’m following this demo:
    https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-custom_rendering.htm

    but how can I add the treeStyleRows at the first column?


    weibao
    Participant

    No, it doesn’t work. I’m talking about custom cellsRenderer here.

    in reply to: jqxPivotGrid sort by row jqxPivotGrid sort by row #104909

    weibao
    Participant

    Does sortBy only work with valueItems? Can rows be sorted by row text?

    in reply to: jqxPivotGrid get row text jqxPivotGrid get row text #104896

    weibao
    Participant

    Here’s my code: console.log(this.pivotGrid1.getPivotRows().items[0].text)
    The error message is: Property ‘text’ does not exist on type ‘PivotGridItem’.
    I checked the source and the interface PivotGridItem does not have the property ‘text’. Do I need to do a type conversion?


    weibao
    Participant

    yes, it works if I move the code to setTimeout. But why?
    Also, the pivotGrid has 1422 rows. When this.pivotGrid1.getPivotRows().items[0].expand() is called, the whole expandable column disappears. It comes back until I click any cell in the grid. Is it a bug?


    weibao
    Participant

    Please ignore the reply above and see this one.

    not working. still got the same error: Cannot read property ‘expand’ of undefined.
    when this.pivotGrid1.getPivotRows().items[0].expand() is called, this.PivotGrid1.getPivotRows.items doesn’t return any items.


    weibao
    Participant

    not working. still got the same error: Cannot read property ‘expand’ of undefined.
    when this.pivotGrid1.getPivotRows().items[0].expand() is called, this.PivotGrid1 is not available yet.


    weibao
    Participant

    This doesn’t work. which selector should I apply for this style?

    my component html:

      <jqxPivotGrid #pivotGrid1
                    [width]="auto"
                    [height]="600"
                    [source]="pivotDataSource"
                    [treeStyleRows]="true"
                    [autoResize]="false"
                    [multipleSelectionEnabled]="true">
      </jqxPivotGrid>

    my component css:

    #pivotGrid1 {
      box-sizing: content-box !important;
    }

    weibao
    Participant

    It seems like that this.pivotGrid1.getPivotRows().items[0].expand() runs before this.createPivotDataSource(data)


    weibao
    Participant

    I got this error message: ERROR TypeError: Cannot read property ‘expand’ of undefined

    Here’s my whole code:

    import { Component, ViewChild, OnInit, AfterViewInit } from ‘@angular/core’;
    import { jqxPivotGridComponent } from ‘jqwidgets-scripts/jqwidgets-ts/angular_jqxpivotgrid’;
    import { jqxButtonComponent } from ‘jqwidgets-scripts/jqwidgets-ts/angular_jqxbuttons’;
    import { ScenarioDetail } from ‘../models/scenarioDetail.model’;
    import { ScenarioDetailService } from “../scenario-detail.service”;

    @Component({
    selector: ‘app-scenario-detail’,
    templateUrl: ‘./scenario-detail.component.html’,
    styleUrls: [‘./scenario-detail.component.css’],
    })
    export class ScenarioDetailComponent implements OnInit, AfterViewInit {
    @ViewChild(‘pivotGrid1’) pivotGrid1: jqxPivotGridComponent;

    scenarioDetails: ScenarioDetail[];
    gridData;
    pivotDataSource;
    source;
    dataAdapter;

    constructor(private scenariodetailService: ScenarioDetailService) {
    this.createPivotDataSource(null);
    }

    ngAfterViewInit(): void {
    this.scenariodetailService.getDefaultScenario()
    .subscribe(data => {
    this.createPivotDataSource(data);
    }, err => {
    console.log(err);
    });

    this.pivotGrid1.getPivotRows().items[0].expand();
    this.pivotGrid1.getPivotColumns().items[0].expand();
    }

Viewing 10 posts - 1 through 10 (of 10 total)