Home » support » General discussion » Building Own Generator ( ) 7 Vote(s)
| | |
| Re: Building Own Generator [message #56947 is a reply to message #56946 ] |
Thu, 24 July 2008 16:46   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
That screenshot is correct, since I removed a lot of stuff from the app-layout you won't have a top-menu in this simple example.
Please find attached a new app.js and tell me if that works.
[Updated on: Thu, 24 July 2008 17:34] Leon
|
|
| | | | | | |
| Re: Building Own Generator [message #57020 is a reply to message #24107 ] |
Fri, 25 July 2008 15:12   |
cmelak Messages: 4 Registered: July 2008 |
Junior Member |
|
|
Hi,
Firstly great job with what you guys are doing!
Well but as for the feedback:
I installed new demoversion and found few problems:
1. I have got trouble with running demo outside dev environment (mainly prod) - seems like problems with css files..? (login page is without shaded rectangle, after login pretty much nothing will show up)
2. Links for editing on datagrid does not work, so once you create something, you cannot edit it
3. With that "<" thingy around sfGuard module - You can solve it by editing " \plugins\sfExtjsThemePlugin\data\generator\sfPropelAdmin\ext js\template\actions\actions.class.php " line 762:
$last = strrpos($column->key, '/');
$cname = substr($column->key, $last + 1);
became >
if(!empty($column->key)) {
$last = strrpos($column->key, '/');
$cname = substr($column->key, $last + 1);
}
4. Although with sfGuardUser - nothing shows at all. On the other hand, sfGuardPermission and sfGuardGroup works fine (though still editing is not working)
5. When I edit "manually" (for example right click + new window) then none of the actions are functional - all are getting error: handler_function is not defined! define the 'handler_function' in your generator.yml file. Note: editing through datagrid (ajax editing cells) works fine. Just links on it are not active.
6. As per request, I've tried linked app.js, however it is not working with demo
That is all for now, if I find something else, I will let you know. Forgive me if I missed some solution/information, however I was reading more than hundred posts on this thread and haven't find anything. Also sorry for my little knowledge of your project, I started with it just yesterday 
Keep up the good work!
Edit: forgot to add basics - running symfony 1.0.17, apache 2.2.6, php 5.2.5, MySQL 5.0.45. Plugin versions as downloaded approximately 3-4 hours ago
[Updated on: Fri, 25 July 2008 15:21]
|
|
| |
| Re: Building Own Generator [message #57033 is a reply to message #57029 ] |
Fri, 25 July 2008 16:51   |
cmelak Messages: 4 Registered: July 2008 |
Junior Member |
|
|
Hi,
thanks for reply, I will keep on trying, I just wrote feedback about demo 
That "<" thingy is actually error Undefined property: sfExtjsAdminColumn::$key ... that you got while using sfGuardPlugin modules (/sfGuardUser, /sfGuardGroup etc), which that condition solves (error, which this produces, is included in raw php code in cache, which results in this output).
I will continue on main project, I hope I will get this theme to work (I am still having few problems that I have with demo..)
[Updated on: Fri, 25 July 2008 16:52]
|
|
| |
| Re: Building Own Generator [message #57169 is a reply to message #57165 ] |
Mon, 28 July 2008 17:33   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
The ThemePlugin generates two kind of panels, which both are extentions of the ordinary Ext.Panel ( http://extjs.com/deploy/dev/docs/output/Ext.Panel.html )
For every module you will get a gridpanel and an editformpanel, these panels can be used in any way you want, you don't even have to have a full extjs layout (with for example a viewport http://extjs.com/deploy/dev/docs/output/Ext.Viewport.html)
Simply define the xtype-name of your-modules panel when defining the viewport/panel-items and you will see the item on your screen.
You also don't have to include the pjs-source as a javascript-include in your header for your panels, the plugin will find the source automatically for you during runtime (lazy loading).
You can also have a gridpanel as a field your edit-panel, or link an edit-panel to your grid. I would advise you to continue defining the layout in your app.js just like you can see in the demo. So seperate html and js(-layout)
So getting a edit-panel is done like this:
// json-config
var editPanel = {
xtype : ('Edit' + 'Invoice' + 'FormPanel').toLowerCase(),
key : key,
//depends on your layout if you want these:
hideBorders : true,
header : false,
width : 900,
height : 700
};
if (key) editPanel.title = 'Loading...';
// create an instance from its xtype
editPanel = Ext.ComponentMgr.create(editPanel);
// init items in panel
editPanel.initItems();
//create a pop-up-window
var editWindow = new Ext.Window({
title : 'Loading...',
modal : true,
items : editPanel,
editPanel : editPanel
});
editWindow.on({
'close' : {
fn : function(){
this.destroy();
},
scope: editWindow
}
});
editPanel.on({
'afterlayout' : {
fn : function() {
var height = this.editPanel.body.dom.scrollHeight; // + this.body.getFrameWidth('tb');
this.editPanel.body.setHeight(height);
var width = this.editPanel.body.dom.scrollWidth; // + this.body.getFrameWidth('tb');
this.setWidth(width);
this.setTitle(this.editPanel.title);
},
scope : editWindow
},
'titlechange' : {
fn : function (p, title) {
this.setTitle(title);
},
scope : editWindow
},
'close_request' : {
fn : function(){
editWindow.close();
},
scope : this
},
'saved' : {
fn : function(){
editWindow.close();
this.store.reload();
},
scope : this
},
'deleted' : {
fn : function(){
editWindow.close();
this.store.reload();
},
scope : this
}
});
//show the pop-up window
editWindow.show();
key is used to pass the primary-key, if undefined you will get a create panel.
To get the item which you requested by url (so index.php/module/action ) you can use the App.RequestedModulePanel (which simply contains an instance of the panel with its xtype (and key when it is an edit-action) set.
Like this:
// content
if (typeof App.RequestedModulePanel == 'undefined') {
App.RequestedModulePanel = new Ext.Panel({html: 'Please login'});
}
this.content_panel = Ext.ComponentMgr.create({
region: 'center',
xtype: 'contentpanel',
activeItem: 0,
border: false,
defaults: {
border: false,
autoScroll: true
},
items: [App.RequestedModulePanel]
});
To see if you are dealing with a grid or a list you can ask the object by something like this:
if (i.getPanelType() == 'list') {
i.getStore().reload();
}
instead of list we also have edit,
testing for key will getKey() you can see if you are dealing with edit or create, modulename will return the module name
(typeof i.getKey === 'function') && (i.getKey() == key)
(i.getModulename() == modulename)
Ps.
at the moment you will also get a editpanel (without form) which is a wrapper around the formpanel, this will probable become obsolete. Also at the moment there isn't yet a panel for filtering, this should be defined in the future as well, but this is still a todo. If anyone can make one I will merge it with the plugin. This filter-panel can be based on the source for grid and form-panels (gridpanel source is somewhat nicer, edit-panel with its form-layout is what you want for filter-panels.
Leon
|
|
| | | | | | | | | | | |
| Re: Building Own Generator [message #57340 is a reply to message #24107 ] |
Wed, 30 July 2008 15:38   |
cmelak Messages: 4 Registered: July 2008 |
Junior Member |
|
|
Hi again,
I have few questions, if I may:
About demo:
1) sfGuardUser module does not appear by default, however it will start showing list of users once I delete partials from display... is there a way to fix this? As I have similar problem with partials on a main project
2) Clicking on an item on the list of orders does not make anything (so you cannot edit a thing), any clue? Again similar to a problem with my main project.
General:
1) on main project I have trouble with problem, where nothing gets listed even though I have data in DB(I mean in list action, it does display empty list, though columns and buttons are present.
2) I have trouble running combos, I followed all possible instructions on wiki, however no success (I need to make fixed associative array for a integer type). Example for "foreignfieldcolumn" makes error, where clicking a create button, does not show anything.
3) I have a question about licensing of this product, as extjs itself is not free for commercial purposes (I want to use it for pretty simple site).
Thanks in advance and keep up the good work!
|
|
| |
| Re: Building Own Generator [message #57723 is a reply to message #57719 ] |
Sun, 03 August 2008 21:32   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
the use of partials is completely different for the extjs-theme, this is not backwards compatible.
in symfony-default you would write html in your partials, with the extjs-theme you write javascript.
Field-partials for grids/lists but also for edit/form-panels are probably obsolete.
You simply use (foreign)field-names (or custom method-names from your lib/object.php file) and if you need a custom editor (also for editable-grids), or your grid needs a custom renderer simple define it under fields.params in your generator.yml
you write the xtype in some javascript you have included in your html-head (or which already exists in ext). You can also include a grid as a field in your form (although at the moment with some wrapper javascript-object).
If you want to combine multiple data-fields in your form-field, simmply provide some datafields in your list/edit.display preceded with a +
Examples are for example the voyage/assignment/parcel-name combined in one column of my grid.
I defined it like this:
list.display: [=subject, +assignment_id/subject, +assignment_id/voyage_id/title]
the field definition
subject:
name: File
params:
editable: false
renderer: this.renderLinkFile
the renderer definition
renderer:
method:
partials: [_renderer_linkFile]
and the renderer for this subject-column, defined in a partial:
<?php ob_start() ?>
//convert keys (replace minus (-) by two underscores (__))
var data = Array();
for (var key in record.data) {
var new_key = key.replace(/-/g, '__');
data[new_key] = record.data[key];
}
var tpl = new Ext.XTemplate(
'<p class=\'fileLink\'>',
// parcels
'<tpl if="assignment_parcel_id != \'\'">',
'Parcel: <a class=\'gridlink\' sf_ns:modulename=\'assignment_parcel\' sf_ns:key=\'{assignment_parcel_id}\' sf_ns:assignmentid=\'{assignment_id}\' href=\'<?php echo $this->getContext()->getRequest()->getScriptName() ?>/assignment_parcel/edit/assignment_parcel_id/{assignment_parcel_id}\'>{subject}</a>',
'</tpl>',
//assignments or voyages
'<tpl if="assignment_parcel_id == \'\'">',
//assignment
'<tpl if="assignment_id != \'\'">',
'Assignment: <a class=\'gridlink\' sf_ns:modulename=\'assignment\' sf_ns:key=\'{assignment_id}\' href=\'<?php echo $this->getContext()->getRequest()->getScriptName() ?>/assignment/edit/assignment_id/{assignment_id}\'>{assignment_id__subject}</a>',
'</tpl>',
//voyage
'<tpl if="assignment_id == \'\'">',
'Voyage: <a class=\'gridlink\' sf_ns:modulename=\'voyage\' sf_ns:key=\'{assignment_id__voyage_id}\' href=\'<?php echo $this->getContext()->getRequest()->getScriptName() ?>/voyage/edit/voyage_id/{assignment_id__voyage_id}\'>{assignment_id__voyage_id__title}</a>',
'</tpl>',
'</tpl>',
'</p>'
);
return tpl.apply(data);
<?php
$source = ob_get_clean();
$renderLinkFile = $sfExtjs2Plugin->asMethod(array(
'parameters' => 'value, params, record, rowIndex, colIndex, store',
'source' => $source
));
$renderer->attributes['renderLinkFile'] = $renderLinkFile;
?>
Leon
|
|
| |
| Re: Building Own Generator [message #58194 is a reply to message #24107 ] |
Thu, 07 August 2008 16:25   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
| trak wrote on Thu, 07 August 2008 16:10 | I would love to use the ExtTheme, but right now is somehow unstable for us. I've tried several times and ran into problems. Now I see that it doesn't work with symfony 1.1. What I think would be awesome is to integrate it with the Form system, that way we could render all the widgets (and the form) with Ext, that would be even more useful since the future admin generator will use the new Form system, therefore one can do any kind of form using Ext. Currently we're developing an sport event management system and all our form and grids are written using Ext. This plugin could really help us in the future or in other projects, but the 1.0 requirement it's very tough right now.
Ivan
|
At the moment there is a Sf1.1 branch in the svn repository by Eric.Fredj
I don't know about its current state, since KRavEN and me are still using sf1.0 and have very little time at the moment to upgrade to 1.1.
The plans about supporting sf1.1 are still vague, for now it depends on the work of Eric.Fredj
I first need to graduate before I can dedicate more time again on development.
Sf1.2 will also be released soon and I try to support that release, maybe skipping sf1.1 although our improvements on 1.0 can be merged with the work of Eric.
Improvements made last week on 1.0 by KRavEN are an added filter-panel, credential checking (for grids) and an improved-code-style.
If you want to support in improving code for 1.1 subscribe as a developer or get into contact with Eric.
Leon
|
|
| | | | | |
| Re: Building Own Generator [message #67067 is a reply to message #24107 ] |
Mon, 08 December 2008 09:55   |
dl28 Messages: 12 Registered: December 2008 Location: Chartres - France |
Junior Member |
|
|
Hi,
I'm a new user of symfony and extjs.
I saw in this post that sfExtjsThemePlugin is not compatible with symfony 1.1 nor 1.2 due to the new form system.
But what about if i want to use only sfExtjs2Plugin to have a treeview in my frontend for example ?
I try it with 1.2 but i had a lot of error, Is this due to the symfony version or due to a misuse of my hand ?
Thanks in advance
[Updated on: Mon, 08 December 2008 09:56]
|
|
| | |
| Re: Building Own Generator [message #67117 is a reply to message #24107 ] |
Mon, 08 December 2008 18:20   |
dl28 Messages: 12 Registered: December 2008 Location: Chartres - France |
Junior Member |
|
|
I install sfExtjs2Plugin (revision 13840) with symfony 1.2 and i try small application with an example of treepanel in the indexSuccess template :
<div id="content_main">
<h1>Accueil</h1>
<?php
$sfExtjs2Plugin = new sfExtjs2Plugin(array('theme'=>'blue'));
$private = array();
$public = array();
$sfExtjs2Plugin->load();
$sfExtjs2Plugin->begin();
// **************************************
// Application
// **************************************
$private['tree']=$sfExtjs2Plugin->TreePanel(array(
'id'=> 'tree-panel',
'title'=> 'Sample Layouts',
'region'=>'north',
'split'=> true,
'height'=> 300,
'root'=> $sfExtjs2Plugin->TreeNode(array(
'draggable'=>false,
'text'=>'the root',
'expanded'=> true,
))
));
$private['detail']=$sfExtjs2Plugin->Panel(array (
'region'=>'center',
'title'=>'Dettagli',
));
$private['main']=$sfExtjs2Plugin->Panel(array
(
'items' => array('tree','detail'),
'height' =>350,
'layout' => 'border',
));
$public['init'] = $sfExtjs2Plugin->asMethod("
Ext.QuickTips.init();
main.render('main');
");
$sfExtjs2Plugin->beginApplication(
array(
'name' => 'Tree',
'private' => $private,
'public' => $public
)
);
$sfExtjs2Plugin->endApplication();
$sfExtjs2Plugin->initApplication('Tree');
$sfExtjs2Plugin->end();
?>
</div>
and i have this error :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="title" content="MediaCoffre" />
<meta name="description" content="Projet MediaCoffre" />
<meta name="keywords" content="MediaCoffre" />
<meta name="language" content="fr" />
<meta name="robots" content="index, follow" />
<title>MediaCoffre</title>
<link rel="shortcut icon" href="/favicon.ico" />
<script type="text/javascript" src="/sfExtjs2Plugin/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/sfExtjs2Plugin/extjs/ext-all-debug.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/sfExtjs2Plugin/extjs/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/sfExtjs2Plugin/patches/fixes.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/layout.css" />
<style type="text/css">#sfWebDebug { padding: 0; margin: 0; font-family: Arial, sans-serif; font-size: 12px; color: #333; text-align: left; line-height: 12px; } #sfWebDebug a, #sfWebDebug a:hover { text-decoration: none; border: none; background-color: transparent; color: #000; } #sfWebDebug img { border: 0; } #sfWebDebugBar { position: absolute; margin: 0; padding: 1px 0; right: 0px; top: 0px; opacity: 0.80; filter: alpha(opacity:80); z-index: 10000; white-space: nowrap; } #sfWebDebugBar[id] { position: fixed; } #sfWebDebugBar img { vertical-align: middle; } #sfWebDebugBar .menu { padding: 5px; padding-left: 0; display: inline; margin: 0; } #sfWebDebugBar .menu li { display: inline; list-style: none; margin: 0; padding: 0 6px; } #sfWebDebugBar .menu li.last { margin: 0; padding: 0; border: 0; } #sfWebDebugDatabaseDetails li { margin: 0; margin-left: 30px; padding: 5px 0; } #sfWebDebugShortMessages li { margin-bottom: 10px; padding: 5px; background-color: #ddd; } #sfWebDebugShortMessages li { list-style: none; } #sfWebDebugDetails { margin-right: 7px; } #sfWebDebug pre { line-height: 1.3; margin-bottom: 10px; } #sfWebDebug h1 { font-size: 16px; font-weight: bold; margin-bottom: 20px; padding: 0; border: 0px; background-color: #eee; } #sfWebDebug h2 { font-size: 14px; font-weight: bold; margin: 10px 0; padding: 0; border: 0px; background: none; } #sfWebDebug .sfWebDebugTop { position: absolute; left: 0px; top: 0px; width: 98%; padding: 0 1%; margin: 0; z-index: 9999; background-color: #efefef; border-bottom: 1px solid #aaa; } #sfWebDebugLog { margin: 0; padding: 3px; font-size: 11px; } #sfWebDebugLogMenu li { display: inline; list-style: none; margin: 0; padding: 0 5px; border-right: 1px solid #aaa; } #sfWebDebugConfigSummary { display: inline; padding: 5px; background-color: #ddd; border: 1px solid #aaa; margin: 20px 0; } #sfWebDebugConfigSummary li { list-style: none; display: inline; margin: 0; padding: 0 5px; } #sfWebDebugConfigSummary li.last { border: 0; } .sfWebDebugInfo, .sfWebDebugInfo td { background-color: #ddd; } .sfWebDebugWarning, .sfWebDebugWarning td { background-color: orange; } .sfWebDebugError, .sfWebDebugError td { background-color: #f99; } .sfWebDebugLogNumber { width: 1%; } .sfWebDebugLogType { width: 1%; white-space: nowrap; color: darkgreen; } .sfWebDebugLogInfo { color: blue; } .ison { color: #3f3; margin-right: 5px; } .isoff { color: #f33; margin-right: 5px; text-decoration: line-through; } .sfWebDebugLogs { padding: 0; margin: 0; border: 1px solid #999; font-family: Arial; font-size: 11px; } .sfWebDebugLogs tr { padding: 0; margin: 0; border: 0; } .sfWebDebugLogs td { margin: 0; border: 0; padding: 1px 3px; vertical-align: top; } .sfWebDebugLogs th { margin: 0; border: 0; padding: 3px 5px; vertical-align: top; background-color: #999; color: #eee; white-space: nowrap; } .sfWebDebugDebugInfo { margin-left: 10px; padding-left: 5px; border-left: 1px solid #aaa; } .sfWebDebugCache { padding: 0; margin: 0; font-family: Arial; position: absolute; overflow: hidden; z-index: 995; font-size: 9px; padding: 2px; filter:alpha(opacity=85); -moz-opacity:0.85; opacity: 0.85; } #sfWebDebugSymfonyVersion { margin-left: 0; padding: 1px 4px; background-color: #666; color: #fff; }</style></head>
<body>
<div id="header">
<ul>
<li><a href="/frontend_dev.php/">MediaCoffre</a></li>
<li><a href="/frontend_dev.php/login">Connexion</a></li>
<li> </li>
<li></li>
</ul>
</div>
<div id="content">
<div id="content_main">
<h1>Accueil</h1>
<script type='text/javascript'>
// sfExtjs2Helper: v0.60
Ext.BLANK_IMAGE_URL = '/sfExtjs2Plugin/extjs/resources/images/default/s.gif';
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>C:\wamp\www\sfprojects\mediacoffre\plugins\sfExtjs2Plugin\lib\helper\sfExtjs2Helper.php</b> on line <b>788</b><br />
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>C:\wamp\www\sfprojects\mediacoffre\plugins\sfExtjs2Plugin\lib\helper\sfExtjs2Helper.php</b> on line <b>788</b><br />
Do you have an idea for this error ?
|
|
|
Goto Forum:
|