We are tryping to use igpivotgrid with olap xmla data source and want to have expand and collapse functionality on button click.
For this, we are using below code
<input type="button" onclick="expand()" value="Expand" />
function expand() { var tuplesCount, membersCount; for (var x = 0; x < dataSource.result().axes().count() ; x++) { tuplesCount = dataSource.result().axes().item(x).tuples().count(); for (var i = 0; i < tuplesCount; i++) { membersCount = dataSource.result().axes().item(x).tuples().item(i).members().count(); for (var j = 0; j < membersCount; j++) { if (dataSource.result().axes().item(x).tuples().item(i).members().item(j).isExpandable()) { dataSource.expandTupleMember(dataSource.result().axes().item(x).name(), i, j); dataSource.update(); } } } } }
After adding a meaure and a dimension, on first "Expand" button click, it throws an error in browser console "TypeError: Cannot read property 'createAxis' of null(…)"
Hello Satish Ganai,
Thank you for posting in our forums!
Using the code you provided, I am able to reproduce the error you are experiencing. I will need a little more time to research why this is occurring and provide a solution.
I will have more information or questions for you tomorrow.
I am discussing this with my team for further assistance with this. I will update you again tomorrow.