I had grid reloading working after form submit in a popup, but now I've changed stuff around and for some reason it stopped working and can't figure out why...
EDIT: See comment below...
Basically, the 'details' page used to not be a subpage of this page but a separate .php file, I prefer the subpage approach, but I must have screwed up somewhere in the transition... I've edited out some stuff that would only make this harder to read.
Does anyone see what I'm missing or where I'm going wrong?
class page_liststuff extends Page {
function initMainPage(){
// parent::init();
$grid = $this->add('Grid');
$this->js('reload_grid',$grid->js()->reload());
$grid->addColumn('button','edit');
$grid->addButton('Refresh')->js('click', $grid->js()->reload());
if($_GET['edit']){
$this->js()->univ()->frameURL('Edit',$this->api->url('details'))->execute();
}
}
function defaultTemplate(){
return array('page/detail');
}
function page_details(){
$m = $this->setModel('Stuff');
$f1 = $stap1->add('Form');
$f1->addSubmit('Save');
if ($f1->isSubmitted()){
try {
$f1->update();
$f1->js()->univ()
->successMessage('Success!')
//->closeDialog()
->getjQuery()->trigger('reload_grid')
->execute();
} catch(Exeception $e) {
$f1->js()->univ()->alert('Fail!')->execute();
}
}
}
}