Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Button on header doesn't work after partial refresh

jme37
Tera Contributor

i have a button on my SN header that opens and closes a side panel. It works fine on most pages but not on the search result page after a search. i think this is due to lazy loading. It can't find the document element in this code and the style 

$scope.openNav = function openNav() {  
        c.data.panel = true;
  document.getElementById("mySidepanel").style.width = "345px";
 
jme37_0-1719329635851.png

 

How can i ensure the header is properly loaded so that mySidepanel is defined ?
 
1 REPLY 1

jme37
Tera Contributor

i think what i need to do is reload/refresh one element on the header rather than reload the whole page - is it possible to do that ?