Advertisement
Guest User

drachenstern

a guest
Oct 20th, 2010
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //For posting to SO http://stackoverflow.com/questions/3982616/deserializing-json-to-c
  2.  
  3.     // has a corresponding file posted at http://pastebin.com/7Tzr2RBz
  4.     // Yes, I'm sure there's a better way to do this.
  5.     // No I don't want you to email me unsolicited and tell me how. Thanks.
  6.     function UpdateLists() {
  7.         if ($(".SplashPanel").size() == 0) { return; }
  8.  
  9.         var items = $(".SplashPanel");
  10.         var str = [];
  11.         function newList(Parent, ID, FileName, Title, ColumnOrder, Height, MinHeight, MaxHeight, Width, Collapsed, CanHide, CanClose, CanRefresh, Settings, RefreshOnColumnChange, Custom) { this.Parent = Parent; this.ID = ID; this.FileName = FileName; this.Title = Title; this.ColumnOrder = ColumnOrder; this.Height = Height; this.MinHeight = MinHeight; this.MaxHeight = MaxHeight; this.Width = Width; this.Collapsed = Collapsed; this.CanHide = CanHide; this.CanClose = CanClose; this.CanRefresh = CanRefresh; this.Settings = Settings; this.RefreshOnColumnChange = RefreshOnColumnChange; this.Custom = Custom; }
  12.         var count = 0;
  13.         $(items).each(function() {
  14.             count++;
  15.             $(this).attr('columnorder', count);
  16.             str.push(new newList($(this).parent().attr('id'), $(this).attr('name'), $(this).attr('filename'), $(this).attr('title'), $(this).attr('columnorder'), $(this).attr('Height'), $(this).attr('minHeight'), $(this).attr('maxHeight'), $(this).width(), String($(this).find(".SplashPanelBody").is(":hidden")), $(this).attr('canHide'), $(this).attr('canClose'), $(this).attr('canRefresh'), $(this).attr('Settings'), $(this).attr('RefreshOnColumnChange'), $(this).attr('Custom')));
  17.         });
  18.  
  19.         $.ajax({ cache: false, type: 'POST', dataType: 'json', contentType: 'application/json; charset=UTF-8', url: 'WidgetHandler.asmx/UpdatePositions', data: JSON.stringify({ "Items": str }), async: false });
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement