Use The Source, Luke

If you plan to do some hard-core development using Agile Toolkit, you will need to learn how to use the source code. The reason, why you need to look into the source is not because lack of documentation, but the extreme simplicity of the components.

Agile Toolkit does not aim to include all of the possible functionaly. On the contrary, it tries to make it possible for you to implement that functionality yourself in a most efficient way.

Let's look at some examples:

Why there is "P" class but no "A" class?

Look at how "P" class is implemented and add it yourself.

class a extends HtmlElement {
  function 
init(){ 
    
parent::init(); 
    
$this->setElement('a'); 
  } 
}

Grid does not have the formatter I want!

Look into the Grid.php just to discover that it's a proxy class. This makes it super-easy for you to extend the class without re-writing your code to show buttons only for certain rows (based on condition):

class Grid extends Grid_Basic {
  function 
format_activeonly($field){
    if(
$this->current_row['status']!='active'){
      
$this->current_row[$field]=' ';
    }
  }
}

$grid $this->add('Grid');
$grid->addColumn('button,activeonly','edit');
    
// will remove button if condition is not met

Make a simpler paginator for Grid!

Look into existing "Paginator" implementation for grid. It works but it's implementation might not suit you. Either you would want more pages to be displayed or text to be different. Instead of enhancing existing Paginator, simply write your own alternative. Below code could be a good start:

class MyPaginator extends View {
  function 
render(){
    foreach(
$this->getPages() as $page=>$text){
      
$this->add('HtmlElement')
        ->
set($text)
        ->
js('click',$this->owner->js()->reload('page'=>$page));
    }
    
$this->recursiveRender();
  }
  function 
getPages(){
    
$results $this->owner->dq->foundRows();
  }
  function 
defaultTemplate(){
    return array(
'mypaginator');  // think about this..
  
}
}