January 2012 Entries

set jqueryUI ThemeRoller cookie

Seems to me that all users prefer a different color scheme for the web apps they work on. With jQueryUI, the themes are available and can be chosen with the themeswitcher gadget. Howerver, out of the box the chosen them only lasts as long as the session. I wanted to change it to last longer. There are some examples on the web of modifying the jqueryUI code, but I found a simpler fix. Change the jqueryUI cookie expire date <script> $(document).ready(function(){ $('#switcher').themeswitcher( ......

jqGrid inline afterSave event

A quick note on the inline afterSave event in jqgrid 4.3.1 I was trying to refresh the grid after adding a row using the inlineNav add row button. I couldn't fire the afterSave method to refresh the grid. Turns out that onSuccess has to be true before afterSave is fired. { name: 'EditOptions', index: 'EditOptions', hidden: false, width: 80 ,formatoptions: { keys: false, editbutton: true, delbutton: true, onSuccess: true,afterSave:function(row... subgrid.trigger("reloadGrid"); ......

Powershell Emailing Strings as attachments

I was working on a project to send a html attachment in a powershell script. I have the HTML string so all I want to do is create an attachment from the string. Here's the code: $SMTPserver = "mail.company.com"$from = "from@company.com"$to = "to@company.com"$subject = "Test PS Attachment"$emailbody = "test"$attText = "The text of the attachment"$attName = "Test.txt" $mailer = new-object Net.Mail.SMTPclient($SMTPse... = new-object Net.Mail.MailMessage($from, $to, $subject, $emailbody) $att = ......