dataGrid()->getNamespace(); // data store url $url = $this->url( array( 'module' => 'site', 'controller' => 'branch', 'action' => 'manage', 'format' => 'json' ) ); // set up columns $columns = array( 'name' => array( 'width' => '71%', 'formatter' => $namespace . '.Formatters.name' ), 'owner' => array( 'width' => '20%', 'formatter' => $namespace . '.Formatters.owner' ) ); if (count($this->actions)) { $columns[] = $this->dataGrid()->getDefaultActionsColumn(); } // set up footer buttons $buttons = array(); $buttons['Add Site'] = array( 'attribs' => array( 'class' => 'add-button', 'onclick' => 'document.location.href = p4cms.url({module: "setup", start: "yes"});', 'disabled' => !$this->showAddSiteButton ) ); $buttons['Add Branch'] = array( 'attribs' => array( 'class' => 'add-button', 'onclick' => $namespace . '.Utility.openFormDialog("add");', 'disabled' => !$this->showAddBranchButton ) ); print $this->dataGrid( $namespace, array( 'gridLabel' => 'branches', 'form' => $this->form, 'url' => $url, 'pageSize' => $this->pageSize, 'actions' => $this->actions, 'columns' => $columns, 'footer' => array( 'buttons' => $buttons ), 'attribs' => array( 'disableSort' => "true", 'selectionMode' => "none", 'fieldTooltips' => array( array( 'attachField' => 'name', 'formatterCallback' => $namespace . '.Formatters.branchTooltip', 'aroundNode' => 'span.name', 'tooltipClass' => 'branch' ) ) ) ) ); ?>