예제 #1
0
$updater = new afExtjsUpdater(array('url' => '/interface/testUpdater', 'width' => '500', 'interval' => '100'));
new afExtjsButton($form, array('label' => 'Trigger Updater', 'handlers' => array('click' => array('parameters' => 'field,event', 'source' => $updater->privateName . '.start();'))));
$form->end();
$layout->addItem('center', $form);
/**
 * SECOND FORM
 */
$form1 = new afExtjsForm(array('action' => '/interface/test', 'frame' => true));
$fieldset = $form1->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' => 'Radu', '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));
$form1->endFieldset($fieldset);
new afExtjsSubmitButton($form1, array('action' => '/interface/test'));
new afExtjsResetButton($form1);
new afExtjsButton($form1, array('label' => 'Just a normal button', 'handlers' => array('click' => array('parameters' => 'field,event', 'source' => 'alert(field.name);'))));
new afExtjsLinkButton($form1, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk', 'icon' => '/images/famfamfam/cancel.png'));
new afExtjsLinkButton($form1, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk'));
new afExtjsButton($form1, array('label' => 'Json Trigger', 'handlers' => array('click' => array('parameters' => 'field,event', 'source' => 'Ext.Ajax.request({ url: "/interface/formJsonButton", method:"post", 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);}}});'))));
$form1->end();
/**
 * add $form1 to window and end window object
 */
$win->addItem($form1);
$win->end();
//$layout->addItem('center',$form1);
$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' => 'Forms'));
$layout->end();
예제 #2
0
 * 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();
<?php

$layout = new afExtjsPanelLayout();
/**
 * USE:
 * stateful = true/false => activate/disable state restore from cookies
 */
$grid = new afExtjsGridCustom(array('autoHeight' => true, 'title' => 'Title'));
/**
 * proxy
 * 
 */
$grid->setProxy(array('url' => '/interface/jsoncustomgrid'));
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'));
$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' => 'Custom Grid'));
$layout->end();