Forum Discussion

abhinavt's avatar
abhinavt
Cloud Apps
05-28-2024
Solved

Merge borders for multiple widgets

Hello,  I'm trying to merge borders for multiple widgets. Lets say if I have two widgets I know I can customize each widget's border style using the below script ,but is there a way to only have 4 b...
  • TriAnthony's avatar
    05-30-2024

    Hi abhinavt,

    You can modify the top/bottom/left/right border configurations to achieve that.

    Here's the updated script for one border surrounding two widgets:

     

    dashboard.on('widgetready', function(sender, ev){
    
    	widgetlist = ['5sd2c75601eafb7y02d4bce89', '61r4d1fb65c615646ee3t523']
    
    	//widget border configurations
    	$.each(widgetlist, function(index, value){
    		
    		widgetelement = $('[widgetid = "' + value + '"]', element)
    		widgetelement.css('border-top', '10px solid #000')
    		widgetelement.css('border-bottom', '10px solid #000')
    		
    		//left widget
    		if(index == 0) {
    			widgetelement.css('border-left', '10px solid #000')
    			widgetelement.css('border-top-left-radius', '15px')
    			widgetelement.css('border-bottom-left-radius', '15px')
    		}
    
    		//right widget
    		else if(index == 1) {
    			widgetelement.css('border-right', '10px solid #000')
    			widgetelement.css('border-top-right-radius', '15px')
    			widgetelement.css('border-bottom-right-radius', '15px')
    		}
    
    	})
    })