コード例 #1
0
 */
$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()}, 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();
/**
 * SOME DOUBLE TREE DATA
 */
$double_tree_options = array(array("text" => "Group 1", "value" => "G1", "leaf" => false, "iconCls" => "folder", "children" => array(array("text" => "Item1", "value" => "item 1", "leaf" => true, "iconCls" => "file"), array("text" => "Item2", "value" => "item 2", "leaf" => true, "iconCls" => "file"))), array("text" => "Group 2", "value" => "G2", "leaf" => false, "iconCls" => "folder", "children" => array(array("text" => "Item3", "value" => "item 3", "leaf" => true, "iconCls" => "file"), array("text" => "Item4", "value" => "item 4", "leaf" => true, "iconCls" => "file"), array("text" => "Item5", "value" => "item 5", "leaf" => true, "iconCls" => "file"))));
$double_tree_selected = array(array("text" => "Group 1", "value" => "G1", "leaf" => false, "iconCls" => "folder", "children" => array(array("text" => "Item11", "value" => "item 11", "leaf" => true, "iconCls" => "file"))));
/**
 * WINDOW FORM
 */
$form0 = new afExtjsForm(array('action' => '/interface/test', 'frame' => true));
$fieldset = $form0->startFieldset(array('legend' => 'Fieldset from second form'));
new afExtjsFieldDoubleTree($fieldset, array('name' => 'my_double_tree', 'label' => 'My double tree', 'help' => 'test help', 'comment' => 'comment on double tree', 'state' => 'editable', 'fromLegend' => 'Options grouped', 'toLegend' => 'Selected grouped', 'options' => $double_tree_options, 'selected' => $double_tree_selected));
new afExtjsFieldInput($fieldset, array('name' => 'my_name', 'label' => 'My Name', 'value' => 'RaduX', 'help' => "'+field.value+'", 'comment' => 'comment on the upper field', 'handlers' => array('change' => array('parameters' => 'field', 'source' => 'alert(field.value);'))));
new afExtjsFieldMultiCombo($fieldset, array('name' => 'my_multi_combo', 'label' => 'My multi combo', 'help' => "multi combo box", 'comment' => 'comment for multi combo', 'options' => array('1' => 'Value 1', '2' => 'Value 2', '3' => 'Value 3'), 'selected' => array('1', '2'), 'state' => 'editable', 'clear' => true));
$form0->endFieldset($fieldset);
new afExtjsSubmitButton($form0, array('action' => '/interface/test'));
コード例 #2
0
 * 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 !
 */
$grid1->setProxy(array('url' => '/interface/jsonactions', 'limit' => 3, 'stateId' => 'gd2'));
/**
 * row actions
 */
$actions = $grid1->startRowActions();
/**
 * action1
 */
$actions->addAction(array('iconCls' => 'icon-edit-record', 'tooltip' => 'Edit'));
/**
 * action2
 * 
 * added confirm&message for action confirmation
 */
$actions->addAction(array('iconCls' => 'icon-minus', 'tooltip' => 'Delete', 'confirm' => true, 'message' => 'Are you sure you want to delete?'));
$grid1->endRowActions($actions);
new afExtjsLinkButton($grid1, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk'));
new afExtjsLinkButton($grid1, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk', 'icon' => '/images/famfamfam/cancel.png'));
$grid1->end();
/**
 * add the grid to the south panel
 */
$layout->addItem('center', $grid1);
$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' => "console.log(panel);")));
$tools->addItem(array('id' => 'close', 'handler' => array('parameters' => 'e,target,panel', 'source' => "panel.ownerCt.remove(panel, true);")));
$layout->addCenterComponent($tools, array('title' => 'Grids'));
$layout->end();
コード例 #3
0
$grid3 = new afExtjsGrid(array('autoHeight' => true, 'clearGrouping' => true, 'title' => 'Grid 3'));
/**
 * columns
 */
$grid3->addColumn(array('name' => 'company', 'label' => 'Company', 'sort' => 'ASC', 'id' => true, 'width' => 40, 'sortable' => true));
$grid3->addColumn(array('name' => 'industry', 'label' => 'Industry', 'groupField' => true, 'width' => 20, 'sortable' => true));
/**
 * proxy
 */
$grid3->setProxy(array('url' => '/interface/jsonactions', 'limit' => 3));
/**
 * row actions
 */
$actions = $grid3->startRowActions();
/**
 * action1
 */
$actions->addAction(array('iconCls' => 'icon-edit-record', 'tooltip' => 'Edit'));
/**
 * action2
 */
$actions->addAction(array('iconCls' => 'icon-minus', 'tooltip' => 'Delete'));
$grid3->endRowActions($actions);
new afExtjsLinkButton($grid3, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk'));
new afExtjsLinkButton($grid3, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk', 'icon' => '/images/famfamfam/cancel.png'));
$grid3->end();
$group2->addItem($grid3, array('title' => 'Third grid', 'tabTip' => 'Third grid'));
$layout->endGroup($group2);
new afExtjsLinkButton($layout, array('label' => 'Next (step2)', 'url' => 'https://192.168.198.136/interface/wizardStep2'));
new afExtjsLinkButton($layout, array('label' => 'Next (step2)', 'url' => 'https://192.168.198.136/interface/wizardStep2', 'iconPosition' => 'right'));
$layout->end();
コード例 #4
0
/**
 * 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($gridf, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk'));
new afExtjsLinkButton($gridf, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk', 'icon' => '/images/famfamfam/cancel.png'));
$gridf->end();
//$layout->addItem('center',$grid);
/**
 * ticket #1180
 */
$layout->setSouthTitleAndStyle('south title test', 'font-weight:bold;color:#cc0000;border:1px solid #cc0000;background-color:#cccc00;');
$html = '<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.';
if (afWidgetHelpSettingsPeer::retrieveCurrent()->getWidgetHelpIsEnabled()) {
    $layout->addHelp($html);
}
/**
* WEST PANEL TREE WITH FILTERS
*/
$filters = new afExtjsTree(array('title' => 'Filters', 'iconCls' => 'server'));
$root_node = $filters->startRoot(array('text' => 'Filters'));
$child = $root_node->addChild(array('text' => 'Incident Reports'));