We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17249 ☆ A M B ☆
    • 165 Posts
    Hello Bruno;
    I'm working on a custom migx to lookup, extract and save some foursquare data for venues so i can do some magic in the front-end later.
    I will need a custom processor to load possible matches in the migx grid and use some custom context button to actually select and save the item i want to link on my local Object.

    so, i created inside my component the following:

    /core/components/MYCOMP/migxconfigs/cms_fq.config.inc.php
    /core/components/MYCOMP/migxconfigs/grid/grid.cms_fq.config.inc.php
    /core/components/MYCOMP/processors/mgr/cms_fq/loadvenue.php

    When the custom action button on top of the grid is clicked i get the following error:

     [2013-07-15 14:15:22] (ERROR @ /assets/components/migx/connector.php) Processor /ROOT_PATH/core/components/migx/processors/mgr/cms_fq/loadvenue.php does not exist; Array
    (
        [processors_path] => /ROOT_PATH/core/components/migx/processors/
        [location] => 
        [action] => mgr/cms_fq/loadvenue
    )
    


    Shouldn't it be loading from /ROOT_PATH/core/components/MYCOMP/processors/ instead?

    This is the code for the button:
    <?php
    
    $gridactionbuttons['cmsLoadFoursquareData']['text'] = "'Load Foursquare Data!'";
    $gridactionbuttons['cmsLoadFoursquareData']['handler'] = 'this.cmsLoadFoursquareData';
    $gridactionbuttons['cmsLoadFoursquareData']['scope'] = 'this';
    $gridactionbuttons['cmsLoadFoursquareData']['standalone'] = '1';
    
    $gridactionbuttons['cmsLoadFoursquareData']['handler'] = 'this.cmsLoadFoursquareData';
    
    $gridfunctions['this.cmsLoadFoursquareData'] = "
    cmsLoadFoursquareData: function() {
    		alert(this.config.url);
            MODx.Ajax.request({
                url: this.config.url
                ,params: {
                    action: 'mgr/[[+config.task]]/loadvenue'
    				,configs: this.config.configs
                    ,co_id: '" . $_REQUEST['object_id'] . "'
                }
               ,listeners: {
                    'success': {fn:this.refresh,scope:this}
                }
            });
        }
    ";



    Here's is the config:
    {
      "formtabs":"[]",
      "contextmenus":"",
      "actionbuttons":"cmsLoadFoursquareData",
      "columnbuttons":"",
      "filters":"[]",
      "extended":{
        "migx_add":"Add One",
        "formcaption":"",
        "update_win_title":"",
        "win_id":"cms_fq",
        "maxRecords":"",
        "multiple_formtabs":"",
        "extrahandlers":"this.cmsLoadFoursquareData",
        "packageName":"cms",
        "classname":"",
        "task":"HELLOWORLD",
        "getlistsort":"",
        "getlistsortdir":"",
        "use_custom_prefix":"0",
        "prefix":"",
        "grid":"",
        "gridload_mode":1,
        "check_resid":1,
        "check_resid_TV":"",
        "join_alias":"",
        "has_jointable":"yes",
        "getlistwhere":"",
        "joins":"",
        "cmpmaincaption":"",
        "cmptabcaption":"",
        "cmptabdescription":"",
        "cmptabcontroller":"",
        "winbuttons":"",
        "onsubmitsuccess":"",
        "submitparams":""
      },
      "columns":[
        {
          "MIGX_id":3,
          "header":"Id",
          "dataIndex":"id",
          "width":"",
          "sortable":"false",
          "show_in_grid":1,
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderoptions":"[]"
        },
        {
          "MIGX_id":1,
          "header":"Title",
          "dataIndex":"name",
          "width":"",
          "sortable":"false",
          "show_in_grid":1,
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderoptions":"[]"
        },
        {
          "MIGX_id":2,
          "header":"City",
          "dataIndex":"city",
          "width":"",
          "sortable":"false",
          "show_in_grid":1,
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderoptions":"[]"
        },
        {
          "MIGX_id":4,
          "header":"CheckIns",
          "dataIndex":"checkins",
          "width":"",
          "sortable":"false",
          "show_in_grid":1,
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderoptions":"[]"
        }
      ]
    }
    
      • 4172
      • 5,888 Posts
                  ,params: {
                      action: 'mgr/migxdb/process'
                      ,processaction: 'loadvenue'
                      ,configs: this.config.configs
                      ,co_id: '" . $_REQUEST['object_id'] . "'
                  }


      the process - processor will route to your processors - path
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!