We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Yar... I’m hoping someone out there is able to help me in my quest to get the built-in widgets documented.

    Here’s my page for the Data Grid:
    http://wiki.modxcms.com/index.php/Data_Grid_Widget

    Man... does ANYONE have a working example of this thing? It’s kinda maddening to have this cool-looking thing built-in, but have no way of using it.
      • 4310
      • 2,310 Posts
      You mean like this ?
      Attached is a screen shot of the TV settings.
      A key area is to do an @SELECT statement querying the DB for the records you want.
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Ok, the only thing I was missing from my implementation was the "text" in the "column types" field. But it’s still a mess. The display puts one character in each row instead of the entire value. E.g.
        Bob Smith

        ends up

        B
        o
        b
        S
        m
        i
        t
        h

        This Widget REALLY needs some documentation.
          • 4310
          • 2,310 Posts
          What’s your Default Value e.g. @SELECT ......
            • 25663 MODX Staff
            • 12,272 Posts
            Quote from: Everettg_99 at Nov 14, 2008, 03:32 PM

            ...This Widget REALLY needs some documentation.

            I think you misspelled deprecation. tongue
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 9207 ☆ A M B ☆
              • 2,475 Posts
              I don’t have anything in my default value... do I need to?

              lol... I mispelled "deprecate". Hilarious.
                • 4310
                • 2,310 Posts
                I thought the reasoning for using the DataGrid was to populate it with rows from the DB.
                In that case you need an @SELECT command to run a MySQL query to get the data.
                Where does Bob Smith come from?
                  • 9207 ☆ A M B ☆
                  • 2,475 Posts
                  Bob Smith is just an example...

                  I’m doing something like @SELECT alias, pagetitle FROM ...

                  so I want my table to look something like this:
                  ----+----------
                  Alias | Page Title
                  ----+----------
                  dogs A page all about Dogs
                  cats A page all about Cats
                  ...

                  Anyhow, putting my query in the default value makes no difference.... I just get all my results peeled down the left hand column, one character per row. I can’t seem to shake that one off... any ideas?



                    • 4310
                    • 2,310 Posts
                    If you have a look at the link I posted earlier you’ll see what
                    @SELECT alias, pagetitle FROM modx_site_content WHERE template = 11

                    in the Default Value field produced for me on a 0.9.6.1p2 install.
                    I remember seeing the first letter thing somewhere before, in a snippet maybe.
                    Wouldn’t have thought it should be present in the @SELECT command, which is part of the core
                      • 9207 ☆ A M B ☆
                      • 2,475 Posts
                      Yeah, I see what you got as your results... I’m not getting that sad

                      The posts I saw about the first letter thing had a resolution by hacking the core, I think... I’m not above making my own widget for this sort of thing, but that’s premature at this point... the Data Grid DOES work, at least for some people... it just doesn’t work for me.

                      Well, if you have any more thoughts, I’d love to hear them... in the mean time, I’ll get back to tinkering and testing this thing.