- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 07:57 PM
Hi All,
I am receiving the current sys_id of the location example america location and i have created three buttons in the HTML code
Server side code :var queueId = $sp.getParameter('location_id');
HTML code :
<div id="buttonContainer">
<button ng-click="home()" ng-if="data.showButton" class="spacedButton" ng-class="{'clicked-button': buttonClicked}" >Office Mgmt</button>
<button ng-click="home1()" ng-if="data.showButton" class="spacedButton" ng-class="{'click-button': buttonClick}">Tech Majilis</button>
<button ng-click="home2()" ng-if="data.showButton" class="spacedButton" ng-class="{'clcked-button': buttonClcked}" >People Exp</button>
</div >
If the location is america than Office Mgmt,Tech Majilis buttons should visible , if the location is Dubai than Tech Majilis and people EXP buttons are visible else Office Mgmt,People Exp should visible .
Can you provide me the code based on the location . I am not able get the code
Thanks and Regards,
Chandan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 10:12 PM
See for two condtion You have make two condtions So you will not able to achieve your condition by just adding ng-if="data.showButton" This only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 09:07 PM
@Sid_Takali Can you help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 09:16 PM
When you are loading you are getting sys id of the Location ..
in server side GlideRecord the location and get the name in a variable .
var locGr=new GlideRecord('cmn_loaction');
if(locGr.get(queueId)){
data.locName=locGr.name;
}
In html
<button ng-click="home()" ng-if="data.locName==america || !(data.locName==dubai)" class="spacedButton" ng-class="{'clicked-button': buttonClicked}" >Office Mgmt</button>
<button ng-click="home1()" ng-if="data.locName==america || !(data.locName==dubai)" class="spacedButton" ng-class="{'click-button': buttonClick}">Tech Majilis</button>
<button ng-click="home2()" ng-if="data.locName==dubai" class="spacedButton" ng-class="{'clcked-button': buttonClcked}" >People Exp</button>
</div >
If this Code solve your query then mark helpfull this article.
Thanks and regards
Suraj sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 10:07 PM
Thank you for giving answer but i want to include this statement also in all the buttons :
ng-if="data.showButton"
Please help me to include this statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 10:12 PM
See for two condtion You have make two condtions So you will not able to achieve your condition by just adding ng-if="data.showButton" This only