Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Handle error when using expandTupleMember for restore state of igPivotGrid

I implement save and restore state of igPivotGird following guide

I use tupleMemberExpanded and tupleMemberCollapsed to save expanded the state of column/row, and using pivotGridRendered to restore.

But when user remove a column which is saved expanded state and using

$("#pivotGrid").igPivotGrid("expandTupleMember", this.axisName, this.tupleIndex, this.memberIndex, true);

to expand, I received the error "Uncaught TypeError: Cannot read property 'hierarchyUniqueName' of undefined" because column don't exist to expand

I don't find the way to check axisName, tupleIndex, memberIndex to remove it form localStorage before using "expandTupleMember". How can I handle above error?

No Data
  • 530
    Verified Answer
    Offline posted

    Hello Bui,

    You can check which columns are currently on the grid with the code below. You would probably need to compare columns stored in the localStorage with columns which are currently on igPivotGrid. 

    pivotGridRendered: function(evt, ui) {
        var rows = $("#pivotGrid").igPivotGrid("option", "dataSource").rowAxis();
        for(var i = 0; i < rows.length; i++){

    If you have any question with this, please let me know.

    Best regards,
    Yuki Mita
    Developer Support Engineer
    Infragistics Inc.

No Data