I implement save and restore state of igPivotGird following guide https://ko.infragistics.com/community/forums/p/107568/506974.aspx#506974
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?
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++){ console.log(rows[i].uniqueName()); }},
If you have any question with this, please let me know.
Best regards,Yuki MitaDeveloper Support EngineerInfragistics Inc.www.infragistics.com/support