Editor dialogs ReloadOnShow property

2 posts, 0 answers
  1. ido nahmias
    ido nahmias avatar
    64 posts
    Member since:
    May 2006

    Posted 22 Apr 2014 Link to this post

    Hello,

    Is there any way to set the default behavior for reloading the editor dialogs?
    I know that you can set the "ReloadOnShow" property for the "DialogDefinition" class but i cant find a way to set it for the editor dialogs.

    Thank you
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 24 Apr 2014 Link to this post

    Hello Ido,

    I can suggest achieving that via client-side approach and set the ReloadOnShow property with the dialog's API.

    I can propose two available implementations:

    • Setting the ReloadOnShow to true to all dialogs that can be set with this property:
      <telerik:RadEditor runat="server" ID="RadEditor1" OnClientCommandExecuted="OnClientCommandExecuted">
      </telerik:RadEditor>
       
      <script type="text/javascript">
          function OnClientCommandExecuted(editor, args) {
              var command = args.get_commandName();
              var dialogs = editor.get_dialogOpener()._dialogContainers;
              var dialog = dialogs[command];
       
              if (dialog && dialog.get_reloadOnShow && !dialog.get_reloadOnShow())
                  dialog.set_reloadOnShow(true);
          }
      </script>
    • Setting it only to the predefined dialogs:
      <telerik:RadEditor runat="server" ID="RadEditor1" OnClientCommandExecuted="OnClientCommandExecuted">
      </telerik:RadEditor>
       
      <script type="text/javascript">
          function OnClientCommandExecuted(editor, args) {
              var command = args.get_commandName();
              var dialogs = editor.get_dialogOpener()._dialogContainers;
              var dialog = dialogs[command];
               
              if (dialog) {
                  var dialogName = command;
                  switch (dialogName) {
                      case "ImageManager":
                          if (dialog && dialog.get_reloadOnShow && !dialog.get_reloadOnShow())
                              dialog.set_reloadOnShow(true);
       
                          break;
                      case "DocumentManager":
                          if (dialog && dialog.get_reloadOnShow && !dialog.get_reloadOnShow())
                              dialog.set_reloadOnShow(true);
       
                          break;
       
                          //You can set further the desired dialogs as the above logic
       
                      default:
                          break;
                  }
              }
          }
      </script>

    Regards,

    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top