Assistance on breadcrumbs widget in service portal.

Nithin12
Tera Expert

Hi Team,

I want to restrict breadcrumbs widget to be read only to all users.

They should be able to modify it, for example:

find_real_file.png

All>Active=true must not be editable, It should be read only.

Here user clicked on All,So now the query is all:

find_real_file.png

So my requirement is to make this query read only. Users should not able to edit this query, always it should be All>Active=true

Can any one suggest/help me on this ?

Thanks in advance.

nathanfirthDeveloper CommunityServiceNow Developers Blog

1 ACCEPTED SOLUTION

Nia McCash
Mega Sage
Mega Sage

Assuming you are using one of the out-of-box "Data Table" widget, you'll see in the server script that the breadcrumbs is defined in the widget named "Filter Breadcrumbs" [ID: widget-filter-breadcrumbs]
data_table_filter.jpg



You will need to create a clone of the "Filter Breadcrumbs" widget to change the behavior and remove the links.



To remove the links and make the text read only, you can change the HTML template of the cloned "Filter Breadcrumbs" widget.
Change:


      <a href="javascript:void(0)" ng-if="!$first" class="sp-breadcrumb-link sp-breadcrumb-remove-condition" ng-click="adjustFilter(crumb, true)">&gt;</a>


      <a href="javascript:void(0)" class="sp-breadcrumb-link" ng-click="adjustFilter(crumb, false)">{{crumb.label}}</a>



to:


      <span ng-if="!$first" class="sp-breadcrumb-link sp-breadcrumb-remove-condition">&gt;</span>


      <span class="sp-breadcrumb-link">{{crumb.label}}</span>



You will likely have to clone the "Data Table" Widget too to point it to your version of the "Filter Breadcrumbs" widget - the one without the links.


View solution in original post

5 REPLIES 5

Nia McCash
Mega Sage
Mega Sage

Assuming you are using one of the out-of-box "Data Table" widget, you'll see in the server script that the breadcrumbs is defined in the widget named "Filter Breadcrumbs" [ID: widget-filter-breadcrumbs]
data_table_filter.jpg



You will need to create a clone of the "Filter Breadcrumbs" widget to change the behavior and remove the links.



To remove the links and make the text read only, you can change the HTML template of the cloned "Filter Breadcrumbs" widget.
Change:


      <a href="javascript:void(0)" ng-if="!$first" class="sp-breadcrumb-link sp-breadcrumb-remove-condition" ng-click="adjustFilter(crumb, true)">&gt;</a>


      <a href="javascript:void(0)" class="sp-breadcrumb-link" ng-click="adjustFilter(crumb, false)">{{crumb.label}}</a>



to:


      <span ng-if="!$first" class="sp-breadcrumb-link sp-breadcrumb-remove-condition">&gt;</span>


      <span class="sp-breadcrumb-link">{{crumb.label}}</span>



You will likely have to clone the "Data Table" Widget too to point it to your version of the "Filter Breadcrumbs" widget - the one without the links.


Perfect .


I'm trying something similar.  where would I change the clone of the data table widget so it point to my new Filter Breadcrumbs widget?

manibaig
Mega Guru

find_real_file.png