Posted By

Freebit on 10/02/09


Tagged

ajax jquery dialog Generic nested


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


JQuery generic dialog example part 1/2


 / Published in: jQuery
 

  1. <script type="text/javascript">
  2. $(function() {
  3. // dialog prepare function
  4. $.prepare_dialog = function() {
  5. $(document).find('body').append('<div id="generic_dialog"></div>');
  6. $('#generic_dialog').dialog({
  7. autoOpen: false,
  8. bgiframe: true,
  9. resizable: true,
  10. height:400,
  11. width: 800,
  12. modal: true,
  13. buttons: {
  14. 'Close': function(){
  15. $(this).dialog('close');
  16. }
  17. }
  18. });
  19. }
  20. // dialog content polling
  21. $.fetch_dialog_content = function() {
  22. $.ajax({
  23. type: 'POST',
  24. url: '{{$base_url_lang}}' + 'system/test/acl_editor_test/get_dialog_content',
  25. success: function(html_input){
  26. $('#generic_dialog').html(html_input);
  27. $('#generic_dialog').dialog('open');
  28. }
  29. });
  30. }
  31. // "click" event registration
  32. $('#open_first_editor').click(function(){
  33. $.fetch_dialog_content();
  34. });
  35.  
  36. // dialog preparation
  37. $.prepare_dialog();
  38.  
  39. });
  40. </script>
  41.  
  42. <div id="main_content">
  43. <a id="open_first_editor">Open First Dialog</a>
  44. </div>

Report this snippet  

You need to login to post a comment.