jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts

  • humam
    Participant

    The Solution Ivo provided didn’t work for me as there can be more than one header generating. But I extended his solution to make it work for me.

     componentDidUpdate (prevProps) {
         if (prevProps !== this.props) {          
           this.source.localdata = this.props.dashboardScoreResult;
           this.refs.jqxgrid.updatebounddata('cells');                
           const headers = document.querySelectorAll('.jqx-grid-header');
           for( let i = 0; i < headers[0].childNodes.length - 1; i++){
             const header = headers[0].childNodes[i];
             header.remove();
           }
           this.setState({dashboardScores: this.props.dashboardScoreResult})
         }
    }

    TLDR: To explain what I’m doing. I took out the flag which doesn’t save much perfomance here. Second I saw that instead of deleting the last node we have to delete all the nodes except for the last one. Because If you play around in inspector in your browser you would see that header elements like sorting only works on the last node. ..

    Shoutout!! to @mrKhanakla for finding the bug!! I could have never thought on my own that there are more than one.

Viewing 1 post (of 1 total)