CHUVASH.eu

CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: popup

Callouts in SharePoint 2013 Preview

While ModalDialog is not default for editing list items in SharePoint 2013 Preview, there is a new “popup” element in SharePoint – callout or popover. I would like to recommend these two blogs when you want discover more:

Andrey Markeev: Callouts (popovers) в SharePoint 2013 Preview (in Russian)

Alex Boev: a three part series:

1. Custom Callouts in the SharePoint 2013 Metro UI: Part 1: Basics
2. Custom Callouts in the SharePoint 2013 Metro UI, Part 2: Actions
3. Custom Callouts in the SharePoint 2013 Metro UI, Part 3: CalloutManager

To get introduced with callouts in SharePoint 2013, you can run this code (from Andrey Markeev’s blog):

myCustomCallout = calloutManager.createNewIfNecessary({
    ID: 'myCallout1',
    title: 'Hello world!',
    content: 'Please, click here.',
    launchPoint: $get('ctl00_DeltaPlaceHolderPageTitleInTitleArea')
});
myCustomCallout.open();

Which will result in:
Custom Callouts in SharePoint 2013 Preview (from Andrey Markeev's blog)

Advertisements

Using javascript objects passed from closed popup

It is not a rocket science to pass objects from child window (popup) to main window. The problem I encountered today was IE and passing complex objects. So it is just an IE issue as far as I know. The problem occurs when you pass some object (not a simple String or Number) to main window:

window.opener.takeAnObjectFromChild = { 
      title: "Should even be available when I close the child" 
};

and you then close the child window, next time the main window tries to access the passed object:

console.log(takeAnObjectFromChild);

you’ll get

The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call did not execute.

Sometimes you can get this error:

Can’t execute code from a freed script

Weird. I saw a solution which “serializes” the object before passing to the main window. But for complex object it would be more headache actually.

A better solution is actually to deep clone the object in the main window before closing the popup. If jQuery is there, just run jQuery.extend, like John Resig said 🙂:

window.myClonedObject = jQuery.extend(true, {}, window.takeAnObjectFromChild);

javascript: passing arguments from popup to main window

To show a popup, we just have to invoke “window.open”, and provide some options to prevent opening this in a new tab:

var wnd = window.open('', '_blank', 'width=750, height=400, location=no, resizable=1, menubar=0, scrollbars=0');
wnd.document.write('');
wnd.document.close(); wnd.document.close(); wnd.focus();

To communicate between parent and child we can refer to parent as window.opener. We can even invoke a function from parent window. Let’s create the most useful function:

foo = function() { console.log("foo"); }

Then just click on “hej” in the popup, and see the console.

Next: Using javascript objects passed from closed popup

Visa en popup-ruta

Visst är det fint med en formulär eller ruta som dyker upp medan ursprungssidan blir mörklagd. I grunden så ändras opacity på hela sidan, blir mörkare. En iframe med högre z-index dyker upp. I den iframe finns en annan sida.

Hur gör man för att ta fram den rutan?

Här berättar jag lite om det:

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Coder, Speaker, Author

Office 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Paul J. Swider - RealActivity

RealActivity is a specialized healthcare services and solution advisory firm.

Mai Omar Desouki - Avid SharePointer

Egyptian & Vodafoner - Senior SharePoint Consultant

Cameron Dwyer | Office 365, SharePoint, Outlook, OnePlace Solutions

Office 365, SharePoint, OnePlace Solutions & Life's Other Little Wonders

paul.tavares

Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

| Blockchain | Serverless Architecture | Microservices Architecture | DevOps | AWS Lambda | Teraform |

SPJoel

SharePoint for everyone

SharePointRyan

Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint

blksthl

Mostly what I know about SharePoint - CommunicoCuspis