We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hi all
    Probably basic question but...

    I have a custom TV (multi items, multi values), I have some listeners like this
    listeners:{
                'change':{
                fn:function(){Ext.getCmp('modx-panel-resource').markDirty();},
                 scope:this
                 }
    }
    

    that 'activates' the 'Save' button of the resource... My question is how can I intercept the 'save' action to perfom some actions of mine (like update custom DB fields and other things) before the resource (and the content of TV) is saved ?

    Thanks...
    Cheers
      • 4172
      • 5,888 Posts
      you can create a plugin which runs at the onBeforeDocformSave - System-Event.

      another way could be to save your db-items directly to the db at the change-event-listener.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 1778
        • 659 Posts
        Thanks Bruno,
        once again your insights are very useful...
        I think I will create a plugin as you recommend, the change event listener is not appropriated for what I want to do...
        Cheers