Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //For posting to SO http://stackoverflow.com/questions/3982616/deserializing-json-to-c
- // has a corresponding file posted at http://pastebin.com/7Tzr2RBz
- // Yes, I'm sure there's a better way to do this.
- // No I don't want you to email me unsolicited and tell me how. Thanks.
- function UpdateLists() {
- if ($(".SplashPanel").size() == 0) { return; }
- var items = $(".SplashPanel");
- var str = [];
- 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; }
- var count = 0;
- $(items).each(function() {
- count++;
- $(this).attr('columnorder', count);
- 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')));
- });
- $.ajax({ cache: false, type: 'POST', dataType: 'json', contentType: 'application/json; charset=UTF-8', url: 'WidgetHandler.asmx/UpdatePositions', data: JSON.stringify({ "Items": str }), async: false });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement