[4.0.4.0] - Get Page Tab Index

Posted by IramK on 09-Jun-2016 04:29

Hello,

Is there a way to retrieve the tab index for a particular tab on the records view page? Say if I have a related records tab called "Contacts" and originally the tab index was 3 but later on I move the tab to another position, lets say 5. I have to keep maintaining the rbf_showOrHidePageTab(3, false); code to match the new index. Is there a way to retrieve the tab index something like rbf_getPageTabIndex("Tab Name"); that would retrieve the tab index and wouldn't need further changes if the order is changed?

Iram

Posted by Vimalkumar Selvaraj on 09-Jun-2016 13:01

Hi Iram,

As Satya said we don't have client side API yet to get index of a tab by name. However i find some workaround for you to get rid of this issue for time being, let me know if this helps you

function getTabIndexByName(name){

var tabStripInstance = rbf_getPageKendoTabStripInstance();

if(tabStripInstance){

var currentItems = tabStripInstance.dataSource.view();

if(currentItems){

  for(var i=0;i<currentItems.length;i++){

     if(name.toLowerCase()===currentItems[i].name.toLowerCase())

 return i;

  }

}

}

return -1;

}

Thanks,

Vimal.

All Replies

Posted by satyanarayana sunku on 09-Jun-2016 07:21

Hi Iram,

Currently rollbase does not have any client side function to get tab index based on Tab name. Please  log enhancement.

Thanks

Satya

Posted by IramK on 09-Jun-2016 08:07

Done thanks.

Posted by Vimalkumar Selvaraj on 09-Jun-2016 13:01

Hi Iram,

As Satya said we don't have client side API yet to get index of a tab by name. However i find some workaround for you to get rid of this issue for time being, let me know if this helps you

function getTabIndexByName(name){

var tabStripInstance = rbf_getPageKendoTabStripInstance();

if(tabStripInstance){

var currentItems = tabStripInstance.dataSource.view();

if(currentItems){

  for(var i=0;i<currentItems.length;i++){

     if(name.toLowerCase()===currentItems[i].name.toLowerCase())

 return i;

  }

}

}

return -1;

}

Thanks,

Vimal.

Posted by IramK on 10-Jun-2016 08:36

Thanks for the answer Vimal. That function works well. How about getting this function in the list of ClientSide API functions in the next release? :)

Cheers.

Iram

Posted by Vimalkumar Selvaraj on 10-Jun-2016 10:56

Hi Iram,

I am glad it worked for you. I added a Enhancement to track , Id is : 44110.. Now its not planned for any release. Will update you when we add this API.

Thanks,

Vimal.

This thread is closed