We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38071
    • 5 Posts
    Hello,
    I'm beginner in ModX and I've spent a lot of days following the RTFM tutorial "Doodles".
    But, in fact, for each dedicated table module, files are always the same !
    4 connectors : getlist, create, remove, update
    1 .js file / table with a grid to edit the table linked to the processors

    So, I've done a generator for these basis files, in Perl ( sorry wink )
    Following the directories tree of the Doodles tutorial, it generates these 5 files for each table. The database schema must be complete before of course. You need to set some paths and informations about fields and the script generates the files to have inline editing grids for all tables/objects of the DB schema.
    The script also generates basic lexicons entries in a special files for copying/pasting them.
    It is a based on 5 files templates placed in a specified directory.

    The main algorithm is based on the DB schema :
    - loop on <object>
    | - looking for the field to use for a search request (for getlist)
    | - generating columns definition for ExtJS grid (TABLE.grid.js)
    | - lexicons generation
    | - looking for the sort field (getlist)
    | - loop on processors actions (getlist, create, update, remove)
    | | - converting templates
    | | - writing file
    | - converting JS template
    | - writing JS file (TABLE.grid.js)

    The JS file contains grid and combobox for the table. The grid is inline editable, even for the aggregates.
    /!\ The composites are not in the grid

    I don't know how really to share it with the community. I've spent hours and I think this script could be very useful ! It's not perfect but I could be a shame to create quite generic script and use it just myself smiley

    I attach example of generated files for my main table. Feel free to ask for !
      • 3749
      • 24,544 Posts
      Great contribution. I'm sure it will be useful. smiley

      If it's just files, I think you could create a package called VegetalTable that installed them to core/components/vegetaltable and submit it at http://modx.com/extras.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 38071
        • 5 Posts
        I don't know if we are talking about the same thing.
        The thing I want to share is the processors + JS generator , I was just giving examples of generation with this table.

        I join the .pl script and the templates (templates not in the ModX meaning !) too, it could be better.
        Feel free to try it if you're beginning a module.