jQWidgets Forums

jQuery UI Widgets Forums Grid Reset Column

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 3 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Reset Column Posts
  • Reset Column #120639

    master3656
    Participant

    How To Reset Column AfterViewInit(Reset All )
    ——————————————————————————
    for example i have a grid and change column after click btn like below code:
    ————————————————————————————
    Col1: any =
    [
    { text: ‘a’, dataField: ‘a’},
    { text: ‘b’, dataField: ‘b’}
    ];
    Col2: any =
    [
    { text: ‘c’, dataField: ‘c’},
    { text: ‘d’, dataField: ‘d’ }
    { text: ‘e’, dataField: ‘e’}
    ];
    ngOnInit() {this.myGrid.columns=Col1;}
    onclikcbtn1() {this.myGrid.columns=Col2;}
    this code not work and column still Col1

    Reset Column #120641

    Martin
    Participant

    Hello master3656,

    Please, take a look at the following Example for dynamically updating the columns.

    Also, note that you cannot use the grid’s reference inside the ngOnInit lifecycle hook as the component is not yet initialized there and it will throw an error.

    Best Regards,
    Martin Yotov

    jQWidgets Team
    https://www.jqwidgets.com/

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

You must be logged in to reply to this topic.