How to refresh grid after update from modal form i

2019-07-28 05:04发布

I have a page with a MVCGrid calling a modal form from external page:

$g1=$p->add('MVCGrid');
$g1->setModel('Student');
$g1->addButton('Add New') 
   ->js('click')
   ->univ()
   ->dialogURL('Add New', $this->api->getDestinationURL('newStudent'));

The external page has the form and works fine:

$f=$page->add('MVCForm');
$f->setModel('Student');
if($f->isSubmitted()){
    $f->update();
    $f->js()->univ()->closeDialog()->execute();
}

But after a new Student is added, the grid is not updated, how do I update it? Is this this the right way to do this? (I'm trying to have a similar function that the CRUD but only for Create.)

标签: atk4
1条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-28 05:55

It's exactly the same as https://stackoverflow.com/a/8966784/204819

put the refresh code as 2nd argument to js() function, while using "null" as first.

查看更多
登录 后发表回答