Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re editing relational data using Autocomplete in modal. #1

Open
ibelar opened this issue Apr 5, 2018 · 1 comment
Open

Re editing relational data using Autocomplete in modal. #1

ibelar opened this issue Apr 5, 2018 · 1 comment

Comments

@ibelar
Copy link
Contributor

ibelar commented Apr 5, 2018

Autocomplete field is not populate with table data when editing a record using a modal.

$app = new \xpdcloud\Admin\App();
$app->add(new \atk4\mastercrud\MasterCRUD())
    ->setModel(new xpdcloud\Model\Customer($app->db),
               [
                   'CustomerPhones'=>[],
                   'CustomerAddress'=>[
                   ],
               ]);

class CustomerAddress extends \atk4\data\Model
{
    public $table = 'customer_address';
    public $title_field = 'type';
    public $title = 'Address';
    function init()
    {
        parent::init();

        $this->addField('type');
        // Field Declaration
        $this->hasOne('customer_id', new Customer());
        $this->hasOne('address_id', [new Address(), 'ui'=>['form'=>['AutoComplete', 'plus'=>true]] ])
            ->addTitle();
        $this->addField('created_on', array('type' => 'datetime', 'system' => 1, 'default' => date('Y-m-d H:i:s')));
    }
}

When editing back the CustomerAddress via the modal dialog, using the grid edit button, then the autocomplete input in modal is not populate with data.

If editing the record via the link using another tab, then autocomplete is workging fine.

Screen shot using a modal edit
mc-using-modal-edit

Screen shot using tab edit:
mc-using-tab-edit

Autocomplete field data is populate correctly in Tab edit but not in Modal edit.

@romaninsh
Copy link
Member

is that an issue with mastercrud?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants