0

I have designed a calendar.I have to open a dialog after selecting the dates.I used a filter option to select the dates. It is working fine. But the issue is dialog is opened for the inactive dates too. I want to open only for the available dates. Any suggestions? the sample is in the link

jQuery("#calendar").selectable({
            filter: ".available",
            stop: function() {
            jQuery( ".ui-selected", this ).each(function() { 
            result.push( this.id); 
            });
            var width = 250;
            var height = 270;
            jQuery('#dialog').dialog({
                    modal: true,
                    height:height,
                    width:width,
                    resizable: false,
                    draggable: false,
                    dialogClass: "flora" 
                });
            jQuery('.flora.ui-dialog').css({ position:"absolute",top:"596px"});

            }
        });

enter image description here

2
  • Please re-frame the question. Where are you facing the problem? What is selectable? Your custom code? A publicly available jQuery plugin? Your code seems to be showing the modal when stop() is called. Who is calling it? If you are filtering to only show available dates, how is the user able to select non available dates? Could you provide a simplified example on jsfiddle.net Commented Jul 4, 2012 at 5:37
  • The sample is jsfiddle.net/8Sd53/3 It display the popup only by clicking the unavailable date.I want to show dialog after selecting the dates only. for example July 01 is unavailable Commented Jul 4, 2012 at 6:22

1 Answer 1

1

Try this. It works on my machine.

http://jsfiddle.net/8Sd53/3/

The change I have made is to use the cancel option.

It will prevent the selection to start if you click on an element that matches the selector passed to the cancel option.

jQuery("#calendar").selectable({
    filter: ".available",
    cancel: ".disabled",  // this is the important piece        
    stop: function() {
    // remaining code
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.