Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
My requirement is, i want to disable tabs dynamically means i have a 7 tabs statically created and i have 3 users. So i want to give the rights to the users individually. in 3 users one is super admin - have to give all tabs enable, second one is admin - have to give 5 tabs enable and last one is user - have to give 3 tabs enable.when the user login, have to check is super admin/admin/user and have to enable respected tabs.

i am new in jquery, can you please any one help me.

Regards,
Posted
Comments
Kornfeld Eliyahu Peter 23-Jun-14 5:37am    
Have you done anything so far? Show some effort (search or code)! As is it ain't a question...
K N R 23-Jun-14 5:49am    
var numbers="";
for (var index = 0; index < 8; index++) {
if (permissions.indexOf($.trim(names.split(',')[index])) == -1) {
if (numbers == "") {
numbers += index;
} else {
numbers += "," + index;
}
}
}
$('#tabname').tabs({ collapsible: true, 'disabled': [numbers], active: true }).css({ 'font-size': 'smaller' })

1 solution

You may try something as mentioned below.

Step 1 : Retrieve your user role by using ajax request from your server.

jQuery.ajax()

Step 2 : According to the above response, disable the relevant tabs.

How do I disable/enable a form element?

I hope this will help to you. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900