* 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
 */
$actions->addAction(array('iconCls' => 'icon-edit-record', 'tooltip' => 'Edit'));
/**
 * action2
 */
$actions->addAction(array('iconCls' => 'icon-minus', 'tooltip' => 'Delete'));
/**
 * REMEMBER:
 * $grid->endRowActions($actions) is commented so you can see that if no actions are associated with the grid then the actions column doesn't appear
 */
$grid->endRowActions($actions);
new afExtjsLinkButton($grid, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk'));
new afExtjsLinkButton($grid, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk', 'icon' => '/images/famfamfam/cancel.png'));
new afExtjsButton($grid, array('label' => 'Send Selections to some url', 'handlers' => array('click' => array('parameters' => 'field,event', 'source' => 'Ext.Ajax.request({ url: "/interface/gridtreeJsonButton", method:"post", params:{"selections":' . $grid->privateName . '.getSelectionModel().getSelectionsJSON(["company","industry","_buttonDescription"])}, success:function(response, options){response=Ext.decode(response.responseText);if(response.message){Ext.Msg.alert("Success",response.message);}},failure: function(response,options) {if(response.message){Ext.Msg.alert("Failure",response.message);}}});'))));
$grid->end();
$layout->addItem('center', $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' => 'close', 'handler' => array('parameters' => 'e,target,panel', 'source' => "panel.ownerCt.remove(panel, true);")));
$layout->addCenterComponent($tools, array('title' => 'Tree Grid'));
$layout->end();
示例#2
0
$filters = new afExtjsTree(array('title' => 'Filters', 'iconCls' => 'server'));
$root_node = $filters->startRoot(array('text' => 'Filters'));
$child = $root_node->addChild(array('text' => 'Incident Reports'));
$child1 = $child->addChild(array('text' => 'Active', 'href' => 'https://192.168.80.128/incidents/list/filter/filter/report/active'));
$child1->end();
$child->end();
$child = $root_node->addChild(array('text' => 'My Incidents'));
$child1 = $child->addChild(array('text' => 'Assigned', 'href' => 'https://192.168.80.128/incidents/list?filters%5Bowner_id%5D=2&filter=filter&report=active'));
$child1->end();
$child->end();
$filters->endRoot($root_node);
$filters->end();
/**
* ADD THE FILTERS TO THE WEST REGION
*/
$layout->addItem('west', $filters);
/**
* GRID TREE FOR WEST PANEL
* ticket #659 START
*/
/**
* USE:
* pager = true/false => activate/disable pagination
* stateful = true/false => activate/disable state restore from cookies
*/
//$grid=new afExtjsGrid(array('iconCls'=>'server','autoHeight'=>false,'title'=>'Tree Grid','root_title'=>'Companies','tree'=>true,'pager'=>false,'frame'=>false));
/**
* columns
*/
//$grid->addColumn(array('name'=>'company','label'=>'Company','sort'=>'ASC','sortable'=>true,'hidden'=>false,'hideable'=>true));
/**