We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34109
    • 119 Posts
    Hi,

    I'm trying to use this.Renderdate with a MIGX tv. I've set manager_date_format to d-m-Y but this isn't having an effect. I have 2.2.3 installed and the code is there in grid.config.inc.php:

    $renderer['this.renderDate'] = "
    renderDate : function(val, md, rec, row, col, s) {
        var date;
        date = Date.parseDate(val, 'Y-m-d H:i: s');
        return String.format('{0}', date.format(MODx.config.manager_date_format+' '+MODx.config.manager_time_format));
    }
    ";


    My grid is defined as:

    [
    {"header": "Week", "width": "50", "sortable": "false", "dataIndex": "week"},
    {"header": "Price", "width": "350", "sortable": "false", "dataIndex": "price"},
    {"header": "Begins", "width": "150", "sortable": "false", "dataIndex": "begins", "renderer": "this.renderDate"},
    {"header": "Ends", "width": "150", "sortable": "false", "dataIndex": "ends", "renderer": "this.renderDate"},
    {"header": "Sold", "width": "50", "sortable": "false", "dataIndex": "sold"}
    ]


    Any ideas on why it's not working?
      Studio Republic
      http://www.studiorepublic.com
      0845 226 3205
      @christodhunter
      • 4172
      • 5,888 Posts
      custom-renderers didn't work in a normal MIGX-grid, only in the default MIGXdb-grid

      with this fix it should now:
      https://github.com/Bruno17/MIGX/commit/5d91ea7f9c27d4f5e448eb5342d6498f2edace11
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 34109
        • 119 Posts
        Bruno - you're a legend! Thanks for your help - working perfectly now smiley
          Studio Republic
          http://www.studiorepublic.com
          0845 226 3205
          @christodhunter