Changeset 8797
- Timestamp:
- 05/05/08 17:00:49 (7 months ago)
- Files:
-
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_form.php (modified) (5 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_addTab.php (modified) (2 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/editAjaxSuccess.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_form.php
r8772 r8797 3 3 4 4 $controller = sfContext::getInstance()->getController(); 5 // TODO: next 2 lines can probably be removed (after small adjustments) 6 //$edit_name = str_replace(".", '_', $edit_key); 5 $sfExtjs2Plugin = new sfExtjs2Plugin(); 6 7 7 $edit_ns = ucfirst(sfInflector::camelize($this->getModuleName()))."Edit"; 8 8 $moduleName = sfInflector::camelize($this->getModuleName()); … … 25 25 $sfExtjs2_<?php echo $moduleName ?>_doSubmit = " 26 26 if (!this.getForm().isValid()) { 27 Ext.Msg.show( {28 title:'Problem',29 msg:'Not all fields (in every tab-page) contain valid data,<br>Please check all fields first',30 modal:true,31 icon:Ext.Msg.INFO,32 buttons:Ext.Msg.OK33 });27 Ext.Msg.show(<?php echo $sfExtjs2Plugin->asAnonymousClass(array( 28 'title' => 'Problem', 29 'msg' => 'Not all fields (in every tab-page) contain valid data,<br>Please check all fields first', 30 'modal' => true, 31 'icon' => $sfExtjs2Plugin->asVar('Ext.Msg.INFO'), 32 'buttons' => $sfExtjs2Plugin->asVar('Ext.Msg.OK') 33 )) ?>); 34 34 } else { 35 35 var url_key = ''; … … 39 39 url_key = '?<?php echo sfInflector::underscore($groupedColumns['pk']->getPhpName()) ?>='+this.ownerCt.key; 40 40 } 41 this.getForm().submit( {42 url: this.url + url_key,43 scope:this,44 success:this.onSubmitSuccess,45 failure:this.onSubmitFailure,46 params:{cmd:'save'},47 waitMsg:'Saving...'48 });41 this.getForm().submit(<?php echo $sfExtjs2Plugin->asAnonymousClass(array( 42 'url' => $sfExtjs2Plugin->asVar('this.url + url_key'), 43 'scope' => $sfExtjs2Plugin->asVar('this'), 44 'success' => $sfExtjs2Plugin->asVar('this.onSubmitSuccess'), 45 'failure' => $sfExtjs2Plugin->asVar('this.onSubmitFailure'), 46 'params' => $sfExtjs2Plugin->asAnonymousClass(array('cmd' => 'save')), 47 'waitMsg' => 'Saving...' 48 )) ?>); 49 49 } 50 50 "; … … 78 78 $sfExtjs2_<?php echo $moduleName ?>_showError = " 79 79 title = title || 'Error'; 80 Ext.Msg.show( {81 title:title,82 msg:msg,83 modal:true,84 icon:Ext.Msg.ERROR,85 buttons:Ext.Msg.OK86 });80 Ext.Msg.show(<?php echo $sfExtjs2Plugin->asAnonymousClass(array( 81 'title' => $sfExtjs2Plugin->asVar('title'), 82 'msg' => $sfExtjs2Plugin->asVar('msg'), 83 'modal' => true, 84 'icon' => $sfExtjs2Plugin->asVar('Ext.Msg.ERROR'), 85 'buttons' => $sfExtjs2Plugin->asVar('Ext.Msg.OK') 86 ))?>); 87 87 "; 88 88 … … 93 93 'width' => 400, 94 94 // 'autoHeight' => true, 95 // 'height' => 200,95 // 'height' => 200, 96 96 97 97 'autoScroll' => true, plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_addTab.php
r8772 r8797 1 1 <?php 2 2 $controller = sfContext::getInstance()->getController(); 3 $sfExtjs2Plugin = new sfExtjs2Plugin(); 4 3 5 $moduleName = sfInflector::camelize($this->getModuleName()); 6 $list_ns = ucfirst(sfInflector::camelize($this->getModuleName()))."List"; 7 4 8 ?> 5 9 if(typeof(closeable)=='undefined') var closeable = true; … … 10 14 if (!(tab = tabPanel.items.find(function(i){return i.key === tabId;}))) { 11 15 using('url(<?php echo $controller->genUrl('js/'.$this->getModuleName()) ?>/editAjaxJs.pjs)', function() { 12 var tab = new Ext.app.sx.Edit<?php echo $moduleName ?>Panel({ 13 // autoLoad : {url: tabUrl, params: params, method: 'POST'}, 14 // id : tabId, 15 // height: 400, //deze aan 16 title : tabTitle, 17 iconCls : icon, 18 closable : closeable, 19 hideBorders: true, 20 key: tabId 21 }); 16 var tab = new Ext.app.sx.Edit<?php echo $moduleName ?>Panel(<?php echo $sfExtjs2Plugin->asAnonymousClass(array( 17 'height' => 400, //deze aan 18 // 'autoHeight' => true, 19 'title' => $sfExtjs2Plugin->asVar('tabTitle'), 20 'iconCls' => $sfExtjs2Plugin->asVar('icon'), 21 'closable' => $sfExtjs2Plugin->asVar('closeable'), 22 'hideBorders' => true, 23 'key' => $sfExtjs2Plugin->asVar('tabId') 24 ))?>); 25 26 tab.on('saved', function(ep, old_key) { <?php echo $list_ns ?>.getDataStore().reload(); } ); 27 tab.on('deleted', function(ep) { <?php echo $list_ns ?>.getDataStore().reload(); tabPanel.remove(ep); } ); 28 tab.on('close_request', function(ep) { tabPanel.remove(ep); } ); 29 22 30 tabPanel.add(tab); 23 31 if(active) { plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/editAjaxSuccess.php
r8793 r8797 1 1 <?php 2 $sfExtjs2Plugin = new sfExtjs2Plugin(); 3 2 4 $moduleName = sfInflector::camelize($this->getModuleName()); 3 5 … … 52 54 editPanel.on('close_request', function(ep) {alert('Close Request: ' + ep.key + ', message from event-handler')} ); 53 55 54 var viewport = new Ext.Viewport({ 55 layout: 'fit', 56 items: [ 57 editPanel 58 ] 59 }) 56 var viewport = <?php echo $sfExtjs2Plugin->Viewport(array( 57 'layout' => 'fit', 58 'items' => array($sfExtjs2Plugin->asVar('editPanel')) 59 )); ?> 60 60 viewport.doLayout(); 61 61 });