Enable / Disable Tab for a group

rss

Posted by wdeffner - Nov 9 ’16 at 10:10

Hi,

Disabling and enabling a tab based on the content of a field works fine like this:

---

// Disable enable Tab
function setAdminTab() {
var status = fd.field('Anrede').control().value();
if (status == 'Frau') {
$('#fd_tabcontrol-0').tabs('option', 'disabled', null);
}  else {
$('#fd_tabcontrol-0').tabs('option', 'disabled', [3]);
}
}

setAdminTab();

---

Now I would like to use the function IsCurrentUserMemberOfGroup in the if-statement but haven't been successful so far (Sharepoint 2013). I'm not familiar with Java-Script.

Thank you

Wolfgang

 

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 11 months 29 days
    #1 by Dmitry Kozlov Nov 10 ’16 at 12:41

    Hi Wolfgang,

    It's not a JS-function. You can use this method to create completely different forms for a certain SharePoint group. Please, watch the video:

    https://www.youtube.com/watch?v=SBLD9hXr19o

    https://www.youtube.com/watch?v=bI7TFO_bN6c

  • wdeffner
    Member
    Member for: 2 years 11 months 27 days
    #2 by wdeffner Nov 11 ’16 at 02:10

    [#1]: Hi,

    we have tried creating different forms based on group-membership or user-defined rules. This works very good and was one of the main reasons for purchasing SPForms.

    However, this leads to a larger set of forms that have to be maintained in parallel. For this reason we were looking for a way to enable/disable single elements based on group-membership and/or user-defines rules.

    If I understand you correctly, this is not possible.

    Thank you

    Wolfgang

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 11 months 29 days
    #3 by Dmitry Kozlov Nov 11 ’16 at 03:51

    [#2]: I see your concern. You can hide or disable fields or tabs conditionally via JavaScript but if the condition is based on user's membership, you should use groups. Please, read the post demonstrating our JS-framework:

    http://formsdesigner.blogspot.com/2014/07/how-to-conditionally-hide-disable-make.html

Displaying 1 to 3 of 3 messages