Post

ColorBox: Call function onClosed

How to use the onClosed callback in the ColorBox jQuery plugin to trigger actions after a popup closes.

A very handy feature of the ColorBox plugin for jQuery is onClosed, allowing you to call a function to, say, rebind a grid when you’ve finished your popup activity.

Example:

1
2
3
4
5
6
7
8
9
10
11
// Show Popup
$.colorbox({
    width: "500px", height: "80%",
    opacity: "0.5",
    iframe: true,
    href: '@Url.Action("GetForm", "Admin")?id=' + Id,
    onClosed: function () {
        // Rebinds my grid
        BindGrid();
    }
});

Posted in: Javascript, JQuery, Quick Tip / Tagged: Javascript, JQuery


Note: This post was salvaged from my old blog at netawakening.azurewebsites.net via the Wayback Machine.

This post is licensed under CC BY 4.0 by the author.