We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    I'm using the great MIGXdb addon to list the child resources of a parent. (see http://rtfm.modx.com/display/ADDON/MIGXdb.Manage+Child-Resources+in+a+grid-TV+with+help+of+MIGXdb)

    Now I was wondering if I can make the 'edit' button not open a popup but just the normal edit screen of a child resource. This would be convenient because on the child resources there are also migxdb tv's. It would get a bit crowded to show that many nested stuff in the migx popup. In Articles this also works this way: if you edit an article the 'normal' edit screen comes up.

    I think I should be looking at core/components/migx/configs/grid/grid.config.inc.php
    around line 38 ($gridcontextmenus['update'] stuff). A wild guess was to change the handler to 'this.editResource (because I have seen this in the Articles addon), but of course it's not working ;-).

    Anyone have an idea how to realize this? I think it will make MIGXdb even more flexible if you have the choice to open a popup for edit or just the normal edit screen. Thanks for any help!
      • 4172
      • 5,888 Posts
      to get a custom-button, which opens the default resource-editor-page, you can do this:

      create a new file under core/components/migx/configs/grid/

      with filename like: grid.[theConfigName].config.inc.php
      this is in this case: grid.childstutorial.config.inc.php

      with this content:

      <?php
      
      $gridcontextmenus['editArticle']['code']="
              m.push({
                  className : 'editArticle', 
                  text: _('migx.edit'),
                  handler: 'this.editArticle'
              });
              m.push('-');
      ";
      
      $gridcontextmenus['editArticle']['handler'] = 'this.editArticle';
      
      $gridfunctions['this.editArticle'] = "
      editArticle: function(btn,e) {
              location.href = 'index.php?a='+MODx.request.a+'&id='+this.menu.record.id;
          }
      ";
      


      Now you can choose the new button 'editArticle' in the migx-Configurator under the columnbuttons-tab and uncheck the 'update' - button

      that should do it.

        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 19328
        • 433 Posts
        Thanks Bruno, it works! Very handy!!!