Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3984362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:45:39+00:00 2026-05-20T05:45:39+00:00

I am facing very strange and difficult problem. I am developing a web app,

  • 0

I am facing very strange and difficult problem. I am developing a web app, where I have created few widgets. If I click on Icon the widget editor will appear in a modular pop-up and user can enter his data and the that data will be presented on dashboard as label. I have "edit" button above the label which is placed on the dashboard, now I want to add a delete button, suppose the user will add the widget on the dashboard and later he finds he doesn’t require that dashboard so he clicks on delete button the widget should be deleted, if user feels he wants that widget again after deleting, when he clicks on the icon of the particular widget which he deleted previously, the widget should appear again. I tried to do that but once I click on the delete button I am able to delete the widget but When I click on the icon of the widget I am not able to get in back.

Please help me to solve this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:45:39+00:00Added an answer on May 20, 2026 at 5:45 am

    Just taking a guess at what you’re looking to do, here’s an example of adding a div that you can close again:

    Setup:

    var WIDGET_MARKUP =
        "<div class='widget'>I'm the widget. " +
        "<span class='close'>Close</span>" +
        "</div>";
    
    // Opens the widget, returns true; if the widget is already
    // open, doesn't open a a second and returns false.
    function openWidget(onClose) {
      var widget;
    
      // If there's already one open, don't do anything
      if ($("div.widget").length > 0) {
        // Already open, don't open another
        return false;
      }
    
      // There isn't, add one
      widget = $(WIDGET_MARKUP);
      widget.appendTo(document.body);
      widget.delegate('span.close', 'click', function() {
        // Remove the widget
        widget.remove();
    
        // Call the callback if any
        if (onClose) {
          try {
            onClose();
          }
          catch (e) {
          }
        }
      });
    
      // true = opened the widget
      return true;
    }
    

    Use:

    $('#btnAddWidget').click(function() {
      var button = this;
    
      if (openWidget(handleClose)) {
        // Opened the widget, disable our button
        button.disabled = true;
      }
    
      function handleClose() {
        // Widget was closd, re-enable the button
        button.disabled = false;
      }
    });
    

    Live example

    Obviously the disabling of the button is only relevant if you want that; if you don’t, just use it like this:

    Setup:

    var WIDGET_MARKUP =
        "<div class='widget'>I'm the widget. " +
        "<span class='close'>Close</span>" +
        "</div>";
    
    // Opens the widget, returns true; if the widget is already
    // open, doesn't open a a second and returns false.
    function openWidget(onClose) {
      var widget;
    
      widget = $(WIDGET_MARKUP);
      widget.appendTo(document.body);
      widget.delegate('span.close', 'click', function() {
        // Remove the widget
        widget.remove();
    
        // Call the callback if any
        if (onClose) {
          try {
            onClose();
          }
          catch (e) {
          }
        }
      });
    }
    

    Use:

    $('#btnAddWidget').click(function() {
        openWidget();
    });
    

    Live example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing a very strange problem. I have a grid and when i
I'm facing very strange problem - my app is working nice on a device
I facing very huge problem now, that is I have usercontrol (created by me)
I am facing this very weird problem, I have created a custom UITableViewCell on
I am facing very strange problem in which I have byte[] and when I
I am facing very strange problem. After debugging from my side, I thought to
I am facing a very strange problem where the same loop keeps giving me
I am facing a very strange issue. I have a SharePoint webpart that displays
I'm facing a apparently very strange problem (I must be doing something wrong, just
I am facing very strange issue. When I was running my app in iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.