hopefully simple questions regarding Agle Toolkit. Currently with the below code getting
Error in AJAX response: SyntaxError: Unexpected token <
BaseException
Record ID must be specified, otherwise use loadAny()
page\grant.php
<?php
class page_grant extends Page {
function init(){
parent::init();
$saveForm=$this->add('MVCForm');
$model=$this->add('Model_Grant')->load($_GET['id']);
$saveForm->setModel($model);
$saveForm->addSubmit();
$saveForm->onSubmit(function($saveForm){
$saveForm->update()->js()->univ()->successMessage('Grant info saved.')->execute();
});
}
}
And Model_Grant:
<?php
class Model_Grant extends Model_Table {
public $table='minigrant';
function init() {
parent::init();
$this->addField('grant_number');
$this->addField('grant_name');
$this->addField('uid');
}
}
Data is loaded fine but cannot save it back as per above error message.