Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Elite Contributor
Posts: 47
Registered: ‎04-26-2009

Using css to format button widths

I have 5 buttons I want to display vertically. When displaying the web client, they are all different lengths dependng on the caption.

 

I added some JS to the form load event:

 

var script = @"require(['dojo/ready', 'Sage/Utility'],
function(ready, utility){ ready(function() {

$('#MainContent_QuoteDetail_FinaliseQuoteButton').css({'width':'150px'});
$('#MainContent_QuoteDetail_CloseQuoteButton').css({'width':'150px'});
$('#MainContent_QuoteDetail_ViewQuoteButton').css({'width':'150px'});
$('#MainContent_QuoteDetail_emailQuoteButton').css({'width':'150px'});
$('#MainContent_QuoteDetail_ReviseQuoteButton').css({'width':'150px'});
$('#MainContent_QuoteDetail_CopyItemsButton').css({'width':'150px'});

 

}); });";
ScriptManager.RegisterStartupScript(this, GetType(), new Guid().ToString(), script, true);

===========================================================

 

this works on the initial page load. However if I click on one of the buttons, a POST is performed and the buttons referent to their original widths.

 

Q: Is there a way to catch this refresh event to re-execute this javascript? 

 

I know I can edit the button widths manually in VS, but this way I don't lose that formatting if a change is made in AA.