We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40385
    • 75 Posts
    It is a custom-table/migxdb config used on a resource.

    Trying to debug. Looks like line 821/grid.config.inc.php is causing the error:

    this.getStore().loadData(items);


    However
    console.log(items)
    is returning the correct csv data. [ed. note: paul_kemp last edited this post 7 years, 8 months ago.]
      • 4172
      • 5,888 Posts
      yeah, this was made for a MIGX-TV. Not for a custom-table.
      Has to be a bit different for importing into a custom-table.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40385
        • 75 Posts
        Ah...I see. Well then I will switch to a MIGX-TV. Shouldn't be a problem for my workflow.
          • 40385
          • 75 Posts
          Okay, it is working with MIGX-TV. Great job. One more question:

          How can I pass properties like delimiter and enclosure to snippets/scripts that are triggered by actionsbuttons?
            • 53322
            • 1 Posts
            Hallo, Bruno
            Maybe you can help me...

            Please help, if it is possible to execute a script - can migx?

            I have a price table - width and height of the price.
            Problem for me is to add an additional table in the database by throwing just such a table for example in csv format (matrix base price)

            I need to after loading the file obtained from the database results in the from of 5 tables:

            id table, > width , < width , > height , < height , price
            with all possible configurations ... that example:

            a width of from 400 to 500 and the height of from 0 to 400 ---> price, next row
            width from 600 to 700 and the height of 0 to 400 -> Price
            width from 700 to 800 and the height of 0 to 400 -> Price
            width from 800 to 900 and the height of 0 to 400 -> Price
            width from 800 to 1000 and the height of 0 to 400 -> Price

            ....

            width from 400 to 500 and the height from 400 to 500 -> Price
            width from 500 to 600 and the height from 400 to 500 -> Price
            width from 600 to 700 and the height from 400 to 500 -> Price


            etc., etc., for all possible options

            All width and height must be in a separate table.
            I need to do with such a database export to json to format...

            {
            "rule": {
            "condition": "AND",
            "rules": [
            {
            "id": "width",
            "field": "width",
            "type": "integer",
            "input": "text",
            "operator": "greater",
            "value": "400"
            },
            {
            "id": "width",
            "field": "width",
            "type": "integer",
            "input": "text",
            "operator": "less_or_equal",
            "value": "500"
            },
            {
            "id": "height",
            "field": "heigh",
            "type": "integer",
            "input": "text",
            "operator": "greater",
            "value": "0"
            },
            {
            "id": "heigh",
            "field": "heigh",
            "type": "integer",
            "input": "text",
            "operator": "less_or_equal",
            "value": "800"
            }
            ]
            },
            "formula": "50"
            }

            My example table
              • 8531
              • 12 Posts
              Hi smiley
              I don't understand how the &tpl-thing is working. In the beginning of the snippet the rowTpl and rowFieldTpl are defined:
              $rowTpl = $modx->getOption('rowTpl', $scriptProperties, '@CODE:<div><ul><li>Line1</li><li>Line2</li><li>Line3</li></ul><ul >[[+_fields]]</ul></div>');
              $rowFieldTpl = $modx->getOption('rowFieldTpl', $scriptProperties, '@CODE:<li>[[+_field]]</li>');

              For a better overview I like to set the tpl within the snippetcall like this:
              [[getCsvFileItems? 
              &file=`tourentest.csv`
              &rowTpl=`csv_rowTpl`
              &rowFieldTpl=`csv_rowFieldTpl`
              &columnheadings=`0`
              ]]

              Result: empty columns
              ...what do I wrong?

              PS:I have already asked my question in the slackchannel, but afterwards I thought that it could be interesting for other users also
                • 4172
                • 5,888 Posts
                what is your csv-code and your tpl-chunks - code?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 8531
                  • 12 Posts
                  I tried to call &rowTpl
                  <div><ul><li>Line1</li><li>Line2</li><li>Line3</li></ul><ul >[[+_fields]]</ul></div>

                  and &rowFieldTpl
                  <li>[[+_field]]</li>

                  my csv is like this:
                  27.08.-29.08.2017;Siegen, Gießen, Bad Hersfeld, Erfurt, Weimar, Saalfeld, Chemnitz;A45/A4
                    • 4172
                    • 5,888 Posts
                    no Fieldnames in the first row?
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 8531
                      • 12 Posts
                      ....no.
                      Quote from: Bruno17 at Jun 09, 2017, 09:45 AM
                      no Fieldnames in the first row?