<?php

$layout = new afExtjsPanelLayout();
/**
 * FIRST GRID
 */
/**
 * USE:
 * pager = true/false => activate/disable pagination
 * stateful = true/false => activate/disable state restore from cookies
 */
$grid = new afExtjsGrid(array('autoHeight' => true, 'root_title' => 'Companies', 'tree' => true, 'pager' => false, 'select' => true, 'frame' => false));
$grid->addHelp('test help');
/**
 * columns
 */
$grid->addColumn(array('name' => 'company', 'label' => 'Company', 'sort' => 'ASC', 'sortable' => true, 'hidden' => false, 'hideable' => true, 'align' => 'left'));
$grid->addColumn(array('name' => 'industry', 'label' => 'Industry', 'sortable' => true));
/**
 * proxy
 * 
 * REMEMBER:
 * stateId attribute must be unique for each view, because with this id Extjs keeps in a cookie the state of start & limit attributes for listjson, see ticket #574; if stateId attribute is not defined, then the state is not kept !
 */
$grid->setProxy(array('url' => '/interface/jsonactionstree', 'limit' => 2));
/**
 * row actions
 */
$actions = $grid->startRowActions();
/**
 * action1
示例#2
0
<?php

$layout = new afExtjsPanelLayout();
/**
 * FIRST GRID
 */
$tools = new afExtjsTools();
$tools->addItem(array('id' => 'gear', 'handler' => array('source' => "Ext.Msg.alert('Message', 'The Settings tool was clicked.');")));
$tools->addItem(array('id' => 'help', 'handler' => array('parameters' => 'e,target,panel', 'source' => "afApp.loadPopupHelp(panel.idxml);")));
$tools->addItem(array('id' => 'close', 'handler' => array('parameters' => 'e,target,panel', 'source' => "panel.ownerCt.remove(panel, true);")));
$grid = new afExtjsGrid(array('autoHeight' => true, 'clearGrouping' => true, 'title' => 'Title', 'frame' => false, 'idxml' => '/interface/grid', 'remoteSort' => true, 'tools' => $tools));
//$grid->addHelp('<b>Lorem ipsum dolor sit amet</b>, consectetur adipiscing elit. Ut est neque, feugiat venenatis elementum a, tincidunt non massa. Cras sagittis, augue nec porttitor scelerisque, elit lorem ornare massa, eu euismod odio massa vitae justo. Mauris erat nunc, luctus tincidunt lacinia ac, sagittis id risus. Mauris ut quam nisl. Mauris tortor eros, tincidunt sit amet fringilla lacinia, faucibus vel augue. Sed dolor felis, faucibus nec elementum at, cursus in magna. Nam erat nibh, auctor fermentum convallis id, ornare vitae urna. Ut placerat elementum felis. Donec quis libero mauris, vitae vehicula mauris. Donec sit amet urna id justo tempus aliquam. Duis aliquam gravida dictum. Nullam ac nibh eros. Donec lacinia risus id velit congue sed placerat nibh fringilla. Vivamus condimentum varius lacus et facilisis. Curabitur sed tellus sit amet diam dictum ornare. Donec dui lacus, vehicula sit amet semper a, auctor sed sem. Nam pulvinar iaculis libero sed varius. Quisque volutpat posuere sapien quis condimentum.');
/**
 * columns
 */
$grid->addColumn(array('name' => 'company', 'type' => 'string', 'label' => 'Company', 'sort' => 'ASC', 'id' => true, 'width' => 40, 'sortable' => true, 'hidden' => false, 'hideable' => true, 'qtip' => true, 'align' => 'right', 'filter' => array('type' => 'string')));
$grid->addColumn(array('name' => 'industry', 'type' => 'int', 'label' => 'Industry', 'groupField' => true, 'width' => 20, 'sortable' => true, 'qtip' => false, 'filter' => array('type' => 'numeric')));
/**
 * proxy
 * 
 * REMEMBER:
 * stateId attribute must be unique for each view, because with this id Extjs keeps in a cookie the state of start & limit attributes for listjson, see ticket #574; if stateId attribute is not defined, then the state is not kept !
 */
$grid->setProxy(array('url' => '/interface/jsonactions', 'limit' => 2, 'start' => 2));
/**
 * row actions
 */
$actions = $grid->startRowActions();
/**
 * action1
 */