HOWTO: Make your MVC edit view class be able to be used for quick creates

bsoremsugar —  December 29, 2010 — 2 Comments

I just ran across this issue in the forums, which I’ve seen a number of times before. The issue is that you have defined a custom edit view class for your module, which works for normal edit view just fine. However, the code isn’t called for any of the “quick create” views, which are those AJAX driven ones that appear in subpanels and in the top navigation bar in the Pro and Enterprise versions. There’s a simple fix for this, in your edit view class, add the following..

public $useForSubpanel = true;

…and the logic in your custom edit view class will be executed.

2 responses to HOWTO: Make your MVC edit view class be able to be used for quick creates

  1. 

    I don’t totally understand this issue. So, if I have module X which is the primary module and Y is the child module related to X. Then, in the subpanel of X, when I try to use quickcreate form to create a Y record, the view.edit.php of Y module should have the line of code below in its ViewEdit class?

        class YViewEdit extends ViewEdit {
           
    public $useForSubpanel = true;

            function YViewEdit(){
                parent::ViewEdit();
            }

            function display() {
                //some logic here.
                parent::display();
            }
           
        }
    Thanks,
    Johnny

  2. 

    Great post ! Thanks for the info. 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s