We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    I've managed to mangle the Doodles-management tutorial to produce a grid of the resources I want. Now, I only want to edit one field for these resources. How can I make that one grid column editable with the double-click method?

    It would also be nice if I could get rid of that filter/search field above the grid, but that's not essential. That one was easy; just remove the dbfilter! [ed. note: sottwell last edited this post 12 years, 11 months ago.]
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 41592 ☆ A M B ☆
      • 83 Posts
      Hello! have you put the save action parameter?

      In your grid configuration add this two line:
      ,save_action: 'link_to_your_mgr_processor/updatefromgrid'
      ,autosave: true


      and then, make your updatefromgrid processor, something like this:
      * parse JSON */
      if (empty($scriptProperties['data'])) return $modx->error->failure('Invalid data2.');
      
      
      $_DATA = $modx->fromJSON($scriptProperties['data']);
      if (!is_array($_DATA)) return $modx->error->failure('Invalid data.');
      
      /* get obj */
      if (empty($_DATA[OBJ_ID])) return $modx->error->failure('obj not specified');
      
      /* manage url */
      $object = $modx->getObject(TBL,$_DATA[OBJ_ID]);
      if (empty($object)) return $modx->error->failure('object not found');
      
      
      $object->fromArray($_DATA);
      
      /* save */
      if ($object->save() == false) {
          return $modx->error->failure('err_save');
      }
      
      return $modx->error->success('',$object);
      


      When you put a save_action to your grid configurations all the field will be editable by default. if you want to make some field not editable just add to your column configuration:
      ,editable: false
      


      hope can help [ed. note: solidusite last edited this post 12 years, 11 months ago.]
        Francesco Mussoni | MODX Ambassador | Skype: solidusite2 | Email: [email protected]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If I were writing my own grid, yes, that's how it's done. But this is a MIGXdb grid. It appears that MIGXdb doesn't support editable grids (yet).

        So I've hacked Resource Explorer to use the publishedon field. Works great. Except I'm still trying to filter its result to only return modStaticResource type resources.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 4172
          • 5,888 Posts
          you can allways make a copy of the default grid, modify it, and use that grid with MIGXdb.
          This copy can be in your package-directory.

          Set the MIGXdb-setting 'grid' to the name of that grid.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!