Free Support Forum - aspose.com

Access Active Tab Index using Client Side Script using Aspose.Cells.GridWeb for .NET

Hi,1. I need to access active tab index or active worksheet index from client side script. Currently I am using this code but worksheet ($grid.attr('acttab')) is always 0 even though I am in the second tab.

$grid = $(GridWeb1);

alert($grid.attr('acttab'));

var mapping = {
worksheet: $grid.attr( 'acttab' )
, row: GridWeb1.getActiveRow()
, col: GridWeb1.getActiveColumn()
, templateId: location.search.split( 'templateId=' )[1]
, dataTableDetailId: parseInt( $( '#depColId' ).val() )
, dataId: parseInt( $( '#dataValueId' ).val() )
}

The grid web has following properties enabled:

GridWeb1.EnableAJAX = true;

GridWeb1.XhtmlMode = true;

GridWeb1.EnableAsync = true;

Please help.

Thanks in advance

Jagriti

Hi Jagriti,

Thanks for your posting and using Aspose.Cells for GridWeb.

I tried to capture the entire HTML using the client side script to know the active tab index of the GridWeb, but unable to capture it properly so I could not find a way to know the active tab index using client side script.

We have therefore logged this issue in our database for investigation. We will look into it and find out what is the correct way to know the active tab index of the GridWeb using client side script and let you know the sample code. Once, there is some update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43127 - Find Active Tab Index using Client Side Script

Hi Jagriti,

Thanks for using Aspose.Cells for GridWeb.

You can use the following jQuery code to find the active tab index of gridweb.

activeTab = $("#GridWeb1").attr(“acttab”);

I have attached the sample project for your reference. Run it and click the Check Active Tab button, it will prompt the index of active tab or sheet of the gridweb. Then change the sheet and click it again, it will again show the current active tab index.