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 8997997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:57:55+00:00 2026-06-15T23:57:55+00:00

Calendar Page: $(document).delegate(‘#ViewOrders’, ‘pageinit’, function () { var ordersSource, calendar; var ordersParams = new

  • 0

Calendar Page:

$(document).delegate('#ViewOrders', 'pageinit', function () {
   var ordersSource, calendar;
   var ordersParams = new Object();
   var tonnageParams = new Object();
   if (parseInt($("#ddlRooms").val()) > 0) {
       tonnageParams.RoomId = $("#ddlRooms").val();
   }

   $.post('/AdminPages/Mobile/Ajax/Ajax.ashx?p=GetTonnage', tonnageParams, function (data) {
       ordersSource = data;

       setTimeout(function () {
           calendar = $("#calendar").fullCalendar({
              header: {
                   left: 'prev,next today',
                   center: '',
                   right: 'title'
               },
               isRTL: false,
               theme: true,
               selectable: true,
               select: function (start, end, allDay) {
                   ordersParams.Start = getDateString(start);
                   ordersParams.End = getDateString(end);

                   if ($("#ddlRooms").val() > 0) {
                       ordersParams.RoomId = $("#ddlRooms").val();
                   }
                   else {
                       delete ordersParams.RoomId;
                   }

                   $.mobile.changePage("ShowOrders.aspx", { data: ordersParams, transition: 'slide', rel: 'dialog' });
                calendar.fullCalendar('destroy');
               },
               events: ordersSource
           });
       }, 500);
   });

   $("#ddlRooms").change(function () {
       var elem = $(this);

       calendar.fullCalendar('removeEventSource', ordersSource);
       tonnageParams = new Object();

       if (parseInt(elem.val()) > 0) {
           tonnageParams.RoomId = elem.val();
       }

       $.post('/AdminPages/Mobile/Ajax/Ajax.ashx?p=GetTonnage', tonnageParams, function (data) {
           ordersSource = data;
           calendar.fullCalendar('addEventSource', ordersSource);
       });
    }); 
 });

Result Page:

$(document).delegate('#ViewOrders', 'pageinit', function () {
$("#btnBack").click(function () {
    var id = $(this).data('backid');
    $.mobile.changePage("ViewOrders.aspx", { data: { RoomId: id }, reloadPage: true, transition: 'slide', reverse: true });
});
});

(The script is located in one file and uploaded at the beginning of the life of the application and does not load any page.)

What I am trying to do is have a page with a calendar. When choosing a date, the user goes to another with the date selected parameter.
On the second page, he sees the orders on that date.
It also has a button back to calendar. My problem is that when he returns to the calendar change event of the select “ddlRooms” – the ‘post’ occurs twice. I tried to do this:

$("#ddlRooms").unbind('change').change(function () {
...
});

but the UI then the select does not work properly.

  • 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-15T23:57:55+00:00Added an answer on June 15, 2026 at 11:57 pm

    There is an alternative to event bind/unbind and on/off. Instead of even unbinding before you bind it again use jQuery event filter, it can be used to identify if event is already been bind.

    http://www.codenothing.com/archives/2009/event-filter/

    This is my usage example:

    $('#carousel div:Event(!click)').each(function(){
    
    });
    

    I am using each because my carousel div has many inner blocks but principle is the same. If #carousel inner div elements don’t have click event add them that event. In your case this will prevent multiple event binding (if that is your problem).

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

Sidebar

Related Questions

$(document).ready(function() { redo(1); $(select).change(function () { var str = ; $(select option:selected).each(function () {
I am generating events on fullCalendar with this code <script type=text/javascript> $(document).ready(function() { $('#calendar').fullCalendar({
I have a very simple jQuery Datepicker calendar: $(document).ready(function(){ $(#date_pretty).datepicker({ }); }); and of
Here is a code of FullCalendar that I am using: $(document).ready(function() { var date
I have an app with a calendar page. On that page I have elements
I'm working on a calendar page that allows a user to click on a
I have the following jQuery code: $(body.page-calendar-practices-2012-05 #content-header h1#title) which works fine. I can
i want to insert php calendar to my page .. which is the best
I'm developing adf calendar events form where the main page displays the calendar when
I use a jquery calendar and a flash in the same page.. What happens

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.