简体   繁体   English

完整日历+ jQuery UI对话

[英]full calendar + jquery ui dialogue

I am using a fullcalendar:- http://arshaw.com/fullcalendar/ 我使用的是fullcalendar: - http://arshaw.com/fullcalendar/

and I am using jquery .post to get a parameter back to the same page to generate some result, and this is working well. 并且我正在使用jquery .post将参数返回到同一页面以生成一些结果,并且此方法运行良好。

At the same time, I wish to use jquery ui dialogue to hold the displayed contents. 同时,我希望使用jquery ui对话框来保存显示的内容。 While pasting the sample codes from official site, the example works. 从官方站点粘贴示例代码时,该示例有效。 However, when combining the .post output with dialogue, it was not successful. 但是,将.post输出与对话结合使用时,它不会成功。

I would like to seek help in combining the below 2 sets of scripts:- 我想在组合以下2组脚本时寻求帮助:-

//for generating .post output (working!) //用于生成.post输出(工作!)

<script>
function event_details(thevalue){
$.post('module/calendar/event_details.php',{
eid:thevalue},

function(output){
    $('#theeventmsg').html(output);
});
}
</script>
<div id='theeventmsg'></div>

//jquery ui dialogue (working!) // jquery ui对话(正在工作!)

<script>
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function() {
    $( "#dialog" ).dialog({
        autoOpen: true,
        show: "blind",
        hide: "explode"
    });

    $( "#opener" ).click(function() {
        $( "#dialog" ).dialog( "open" );
        return false;
    });
});
</script>



<div class="demo">
<div id="dialog" title="Basic dialog">
    <p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<button id="opener">Open Dialog</button>
</div><!-- End demo -->

Can help??? 能够帮助??? Thanks a lot!! 非常感谢!!

Try something like this: 尝试这样的事情:

<script>
  $.fx.speeds._default = 1000;

  $(document).ready(function() {
    $( "#dialog" ).dialog({ autoOpen: false });

    $('#button').click(function () {
      var data = { ... };

      $.post('module/calendar/event_details.php', data, function (output) {
        $('#dialog p').html(output);
        $( "#dialog" ).dialog("open");
      });
    });
  });
</script>    

<div id="dialog">
  <p>content</p>
</div>

<button id="button">button</button>

Or: 要么:

<script>
  $(document).ready(function () {
    function eventdetail(thevalue) {
      $.post('event_details.php', { eid: thevalue }, function (output) {
        $('#dialog p').html(output);
        $("#dialog").dialog({ autoOpen: true });
      });
    }

    $('#button').click(function () { eventdetail('value'); });
  });  
</script>

<div id="dialog">
  <p>content</p>
</div>

<button id="button">button</button>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM