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

  • Home
  • SEARCH
  • 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 8012277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:16:58+00:00 2026-06-04T19:16:58+00:00

I have a model which, when opened, loads a partial view. The partial view

  • 0

I have a model which, when opened, loads a partial view.

The partial view has a jQuery function. When the modal is opened the jQuery does not run.

As soon as I resize the modal at all, the jQuery is run and the expected results occur.

Here is the code that loads the html and opens the modal

 $(document).ready(function () {
        $("#reschedule").button().click(function () {

                            var url = $("#rescheduleUrl").attr('href');

                            $.ajaxSetup({ cache: false });
                            $.ajax({
                                url: url,
                                success: function (data) {
                                    $("#rescheduleDiv").html(data);
                                    $("#rescheduleDiv").dialog('open');
                                }
                            });
        });
    });

and from the partial view that is loaded, here is the jQuery that I need to run right away.

$('#calendar').fullCalendar({
    theme: true,
    header: {
        left: 'month,agendaWeek,agendaDay',
        center: 'title',
        right: ''
    },
    defaultView: 'agendaWeek',
    editable: false,
    minTime: 5,
    maxTime: 20,
    events: "/ServiceTicket/GetCalendarEvents/",
    allDaySlot: false
});

I have also tried it wrapped in

   $(document).ready(function() {
     ...
   });

with the same result.

any thoughts what I need to do to get this to run right away? I have watched it in firebug and it does run when the modal is re-sized but not until then.

Thanks!

  • 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-06-04T19:17:00+00:00Added an answer on June 4, 2026 at 7:17 pm

    I think you need to wrap the partial view JQuery in a document.ready function as well. This is how we get JQuery to fire in a colorbox modal that is ‘popped’ up from a partial view

     $(document).ready(function () {
    $('#calendar').fullCalendar({
        theme: true,
        header: {
            left: 'month,agendaWeek,agendaDay',
            center: 'title',
            right: ''
        },
        defaultView: 'agendaWeek',
        editable: false,
        minTime: 5,
        maxTime: 20,
        events: "/ServiceTicket/GetCalendarEvents/",
        allDaySlot: false
    });
    });
    

    EDIT

    I think reversing the load/show functions in your parent page may solve the issue.

    success: function (data) {    
        $("#rescheduleDiv").dialog('open');
        $("#rescheduleDiv").html(data);
     } 
    

    By populating the html before ‘showing’ the dialog, the doc.ready function may not ever be firing along with your event handers until you interact with the dialog. If you show it first, then load the html data, your event handlers show work as expected.

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

Sidebar

Related Questions

I have model show which has_many performances and a performance has a certain location.
I have model Foo which has field bar. The bar field should be unique,
I have a model which has a certain behaviour implemented. class X { ....
I need to have a model which will behave like a embedded and not-embedded.
I'm using ASP.NET MVC and have a model which has an image (byte array)
I have a html link in which a modal window will be opened while
I am creating a modal view which is opened using the following code [[self
I have a model which includes a module. I'd like to override the model's
I have django model which consist of parent child relationship filed I want to
I have a model which defines a property with either markdown or html content.

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.