Home » support » General discussion » Building Own Generator ( ) 7 Vote(s)
| |
| Re: Building Own Generator [message #40707 is a reply to message #24107 ] |
Sat, 01 December 2007 20:47   |
mattlody Messages: 22 Registered: September 2007 Location: Wales, UK |
Junior Member |
|
|
Leon,
This plugin looks fantastic. I can't wait to start using it!
Just installed it now and I'm being told
Unable to parse query string "=".
I notice it says that on your demo as well. Maybe a recent commit? Any ideas on how it might fix it?
Keep up the good work Leon, it's looking fab.
|
|
| | | |
| Re: Building Own Generator [message #40729 is a reply to message #24107 ] |
Sun, 02 December 2007 23:32   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
The columns in lists should now show up correctly.
There is only one problem remaining, if you have set the list.grouping.field and a list.grouping.display (E.G. country/name and country/abbreviation in the group-header of country/name) and you also want to show the list.grouping.field (country/name) in the grid as a column (you defined it in the list.display array) you will see this column has the same renderer as the grouping-header. This can be fixed but does not have my priority.
I hope I will now finally can work on the return of the drop-down combo boxes and don't find other more important problems.
Ps. I am aware of the ugly js-code which is produced, in which columns are sometimes defined multiple times (E.G. in the datastores), this is a todo for later...
[Updated on: Sun, 02 December 2007 23:48] Leon
|
|
| |
| Re: Building Own Generator [message #40776 is a reply to message #40731 ] |
Mon, 03 December 2007 15:01   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
Drop-down combo-boxes are improved,
autocompletion works again.
todo's/problems remaining concerning grids:
1. as said before, you cannot use a field both as group-by-field and column in your grid. This will make drop-down comboboxes not working (see city/country-name)
2. Saving you changes from the grid.
Other todo's:
1. Fix edit-pages
2. probably filter-pages are broken as well, since we use other field-names
Other-other todo's: (less important)
1. We sometimes use the old way of retreiving columns (not with the new methods:
$groupedColumns = $this->getColumnsGrouped($for, true);
$columns = $this->getListColumns($groupedColumns, false);
2. datastores need a check to filter double fieldnames (easy)
I will concentrate on getting the edit-pages (with fieldsets) to work
[Updated on: Mon, 03 December 2007 15:19] Leon
|
|
|
| Re: Building Own Generator [message #40795 is a reply to message #24107 ] |
Mon, 03 December 2007 21:49   |
mattlody Messages: 22 Registered: September 2007 Location: Wales, UK |
Junior Member |
|
|
Leon,
Thanks for all the hard work you've put in and are continuing to do.
I've had a couple of little things the last few days - as of the current revision (6307) nothing appears (not even a grid, just the grey box with the page title). Prior to this, I was getting a lot of columns with '.name' as the heading, and the grid wasn't fillig with content. Are there some settings to be set in app.yml?
You're putting a lot of work in Leon - I'm so impressed - I'd like to donate if I can. Where can I do this?
Thanks again
Matt
|
|
| |
| Re: Building Own Generator [message #40804 is a reply to message #24107 ] |
Tue, 04 December 2007 01:43   |
mattlody Messages: 22 Registered: September 2007 Location: Wales, UK |
Junior Member |
|
|
| Quote: | You can currently donate by testing and maybe writing documentation (readme/howtos)
|
Testing and relaying problems seems a little unfair - if I get some time, I'd be happy to write some docs though - though I'm pretty new to this plugin and need to learn the ropes a little.
_edit_form_ajax.php has stopped having the [? and ?] php sections parsed since revision 6308. It's just being output to the browser as text, starting from line 21:
// provide attractive and customizable tooltips for any element, once we use it ;) Ext.QuickTips.init(); // turn on validation errors beside the field globally Ext.form.Field.prototype.msgTarget= 'under'; [?php include_partial('related_ajax_stores') ?] var Edit = function(){ // define private variables var formArea[?php echo $sf_request->getParameter('id', 0) ?] = null; // return a public interface return { /* ************************************* * init ************************************* */ init : function() { // TODO etc....
Strangely, this doesn't apply to all modules, only some - I'm trying to get to the bottom of why this is.
On the modules that render, the grid isn't displayed, just the grey box with the title.
Going to go away and play with app.yml - think the answer lies there?
Thanks Leon
Matt
|
|
|
| Re: Building Own Generator [message #40805 is a reply to message #40804 ] |
Tue, 04 December 2007 01:50   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
| mattlody wrote on Tue, 04 December 2007 01:43 |
| Quote: | You can currently donate by testing and maybe writing documentation (readme/howtos)
|
Testing and relaying problems seems a little unfair - if I get some time, I'd be happy to write some docs though - though I'm pretty new to this plugin and need to learn the ropes a little.
|
feel free to ask if something is unclear
| mattlody wrote on Tue, 04 December 2007 01:43 |
_edit_form_ajax.php has stopped having the [? and ?] php sections parsed since revision 6308. It's just being output to the browser as text, starting from line 21:
|
this is under heavy development... I am working on it while we "speak".
| mattlody wrote on Tue, 04 December 2007 01:43 |
// provide attractive and customizable tooltips for any element, once we use it ;) Ext.QuickTips.init(); // turn on validation errors beside the field globally Ext.form.Field.prototype.msgTarget= 'under'; [?php include_partial('related_ajax_stores') ?] var Edit = function(){ // define private variables var formArea[?php echo $sf_request->getParameter('id', 0) ?] = null; // return a public interface return { /* ************************************* * init ************************************* */ init : function() { // TODO etc....
Strangely, this doesn't apply to all modules, only some - I'm trying to get to the bottom of why this is.
|
I noticed this as well, you can also see it in the live demo, the normal does not work (if I recall correctly) while the master-detail does. Really strange, but as said I am working on it. I expect to fix some things this night.
| mattlody wrote on Tue, 04 December 2007 01:43 |
On the modules that render, the grid isn't displayed, just the grey box with the title.
Going to go away and play with app.yml - think the answer lies there?
|
I don't think so... I don't know what causes the problem, but I am not really looking for the cause, since I am currently rewritting a lot (which probably fixes the problem automatically)
| mattlody wrote on Tue, 04 December 2007 01:43 |
Thanks Leon
Matt
|
Leon
|
|
| | |
| Re: Building Own Generator [message #40860 is a reply to message #24107 ] |
Tue, 04 December 2007 14:46   |
gouiggou Messages: 44 Registered: October 2005 Location: Paris |
Member |
|
|
Hi Leon,
Sorry I have not many time to work on the plugin at the moment.
I fix some other bug.
I send you a new patch (contain my old patches updated for the new version).
I see two things not work correctly:
- I have to define the related primary key of use related field in my generator.yml (ie: "client/nom" => I have to add in display section "client_id" wich is the foreign key for "client" table.
- Imagine one table where we have 2 foreign key on a same related table (ie: client1_id and client2_id for table client), the getForeignKeyToTable function does not work...
Your method for grouped column is very nice, I could see it in detail during the debug!
I can now continue with you, for optimisation or features addition.
Jérôme M.
|
|
| |
| Re: Building Own Generator [message #40970 is a reply to message #40878 ] |
Wed, 05 December 2007 16:41   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
Merry Sinterklaas everyone (http://en.wikipedia.org/wiki/Sinterklaas)
As a present I've got a nice update today:
List and Edit-pages start to work again, with drop-down combo-boxes.
There are of course enough todo's remaining:
1. (pre-)loading of combo-box-data is broken (which you'll see when you drop box down)
2. most important: SAVING! I am going to work on this.
3. filtering (it needs to be altered to the new data stucture)
[Updated on: Wed, 05 December 2007 16:41] Leon
|
|
| | |
| Re: Building Own Generator [message #41151 is a reply to message #41138 ] |
Fri, 07 December 2007 20:11   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
Hi snk00sj,
Thanks for updating the wiki.
If you've got questions, you know where to find me 
I think the current code is getting stable enough to not requiring the documentation to change every time, so perfect timing.
Today I fixed some small bugs related through preloaded values for drop-down combo-boxes. At the moment I am working on improving the edit-pages, but you can already see the effect on the list-pages.
Regarding the documentation, I took a look at the wiki and thanks for the tip about svn:externals (I didn't knew that yet).
- Sort on foreign- and composite-columns, this will be done differently. Foreign tables probably don't require this at all, since the information can be now be found in the field-name already. For partials a sort-property will be nice, but the fields can be defined in the same way as for display-fields (so country/name) and I now know how to resolve the foreign-keys so join_fields will be obsolete.
- Master detail is done completely different (see example about city-master detail (you need to define a peer_method, and the rest is grouping) ).
Leon
|
|
| | |
| Re: Building Own Generator [message #41270 is a reply to message #24107 ] |
Mon, 10 December 2007 02:46   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
Hello KRavEN and Kubens
how is your work going?
I was trying out your work and I think I hit on a limitation at the moment. I want to define the autoLoad property of a Panel by providing it an Array, but this seems not to be possible. If I define:
<?php $sfExtjs2Plugin->Panel(array(
'autoLoad' => array(
'url' => 'city_grouped',
'scripts' => 'true',
),
'title' => 'Grouped Grids',
'autoScroll' => 'true'
)) ?>
I get
new Ext.Panel ({autoLoad:Array,title:'Grouped Grids',autoScroll:true})
instead of the desired
new Ext.Panel ({autoLoad:[url:'city_grouped',scripts:true],title:'Grouped Grids',autoScroll:true})
Is that correct and should I do this someway else or can you solve this? I haven't searched for a solution yet, since you probable already where aware of this problem, and maybe no a way to work around it... And it is time to sleep...
Leon
|
|
|
| Re: Building Own Generator [message #41350 is a reply to message #41270 ] |
Tue, 11 December 2007 01:54   |
 |
lvanderree Messages: 652 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
I found the problem,
it is in _build_attributes at line +/- 435, which says:
$attributes .= sprintf('%s%s:%s', ($attributes === '' ? '' : ','), $key, $value);
which is very nice, except for sprintf-ing $value, without testing if it is an array...
I added this function to recursively handle arrays, although it probable can use something like the quote_except function 
private static function _process_value($value = '')
{
if (is_array($value))
{
$array_value = $value;
$value = '{';
foreach ($array_value as $key => $v)
{
if (!is_array($v) && ($v != 'true') && ($v != 'false'))
{
$value .= sprintf('%s%s:\'%s\'', ($value === '{' ? '' : ','), $key, sfExtjs2Plugin::_process_value($v));
}
else
{
$value .= sprintf('%s%s:%s', ($value === '{' ? '' : ','), $key, sfExtjs2Plugin::_process_value($v));
}
}
$value .= '}';
}
return $value;
}
It is in the svn.
I have also updated the live demo. To see the new functionality, change the name of a country, to a non-existing country-name and leave the field.... (it is not finished, but I assume you get the idea ) (I will fix the layout later, the accordion layout isn't very appropriate is it )
Leon
|
|
|
| Re: Building Own Generator [message #41375 is a reply to message #41350 ] |
Tue, 11 December 2007 10:20   |
snk00sj Messages: 71 Registered: July 2006 |
Member |
|
|
Leon,
After your last update i get the following error :
// ------------------------ // SETUP THE GRID COLUMNMODEL // ------------------------
Fatal error: Class 'sfExtjs2Plugin' not found in /path/webroot/plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php on line 885
Looking at your changesets i think this is the problem :
http://trac.symfony-project.com/changeset/6437
Line 885-887
$sfExtjs2Plugin = new sfExtjs2Plugin(array('theme'=>'gray'));
//$sfExtjs2Plugin->load();
//$sfExtjs2Plugin->beg
I see more lines using $sfExtjs2Plugin are commented, when following this thread i had the idea the Ext framework wasn't extracted from this plugin just yet, right ?
In case i was mistaking I tried loading the http://trac.symfony-project.com/wiki/sfExtJSPlugin plugin, but still no luck there. Is there anything i am overlooking ?
[Updated on: Tue, 11 December 2007 10:22] Digital Base Webagency
|
|
| | | |
| Re: Building Own Generator [message #41383 is a reply to message #24107 ] |
Tue, 11 December 2007 11:08   |
snk00sj Messages: 71 Registered: July 2006 |
Member |
|
|
yes, fixed
Something else, i was looking how to include actions in the grid. (for example approve/decline, edit icon, etc). A nice start would be to include partials in the grid itself.
Is this supported at this time ? I tried using _partial in the generator.yml (like it works in normal admin generator), but as soon as i do this, the resultset is empty.
list:
max_per_page: 10
title: Postal Code
display: [postalcode, name, country/name]
filters: [postalcode, name, country/name]
peer_method: doSelectJoinCountry
The partial i am using is just a file with a string in it (no code, yet )
[Updated on: Tue, 11 December 2007 11:29] Digital Base Webagency
|
|
| |
| Re: Building Own Generator [message #41399 is a reply to message #41390 ] |
Tue, 11 December 2007 13:16   |
snk00sj Messages: 71 Registered: July 2006 |
Member |
|
|
thanks for that.
Another thing, i wanted to work with multiple relations on a single object (company-country, company-postalcode), and i am trying to defined multiple joins in the generator.yml. For that it would be handy i could see the query being executed.
The symfony toolbar isn't showing the query on page load (only this one :
[0.47 ms] SELECT COUNT(company.ID) FROM company)
So i am guessing a javascript/ajax caller does that.
There is a way to update the toolbar when using ajax calls (see : http://trac.symfony-project.com/wiki/sfAjaxWebDebugPlugin). One downside though :
From the plugin wiki :
| Quote: |
After completing the AJAX request you should call the javascript function getAjaxWebDebug() to update the toolbar.
|
Where should i put this function to make sure it is updated each extjs background action ? It would be nice to integrate this in the plugin, just an idea :
1/ the plugin detects if you have sfAjaxWebDebugPlugin enabled
2/ if so it always (when debugbar is enabled) calls the getAjaxWebDebug() javascript function
This way we make sure people can see wat is happening in the background (using the toolbar).
[Updated on: Tue, 11 December 2007 13:17] Digital Base Webagency
|
|
| | |
| Re: Building Own Generator [message #41441 is a reply to message #41435 ] |
Tue, 11 December 2007 18:25   |
excessivedemon Messages: 49 Registered: March 2007 |
Member |
|
|
thanks for your reply.. yes.. json appears correct.. here it is:
{totalCount:"7", data:[ { "parcel-id": "1", "parcel-assignment_id": "1", "parcel-name": "Parcel 1 for Assignment 1", "parcel-assignment-name": "Assignment 1" }, { "parcel-id": "2", "parcel-assignment_id": "1", "parcel-name": "Parcel 2 for Assignment 1", "parcel-assignment-name": "Assignment 1" }, { "parcel-id": "3", "parcel-assignment_id": "2", "parcel-name": "Parcel 1 for Assignment 2", "parcel-assignment-name": "Assignment 2" }, { "parcel-id": "4", "parcel-assignment_id": "2", "parcel-name": "Parcel 2 for Assignment 2", "parcel-assignment-name": "Assignment 2" }, { "parcel-id": "5", "parcel-assignment_id": "3", "parcel-name": "Parcel 1 for Assignment 3", "parcel-assignment-name": "Assignment 3" }, { "parcel-id": "6", "parcel-assignment_id": "3", "parcel-name": "Parcel 2 for Assignment 3", "parcel-assignment-name": "Assignment 3" }, { "parcel-id": "7", "parcel-assignment_id": "3", "parcel-name": "Parcel 3 for Assignment 3", "parcel-assignment-name": "Assignment 3" }]}
any more things i could try? By the way.. I noticed no city/country is returned when browsing to:
http://fun4me.demon.nl/test/index.php/city
but there are cities/countires when browsing:
http://fun4me.demon.nl/test/test_dev.php/city
anyway.. any other things i can try? thanks again..
|
|
| |
| Re: Building Own Generator [message #41453 is a reply to message #41445 ] |
Tue, 11 December 2007 19:38   |
excessivedemon Messages: 49 Registered: March 2007 |
Member |
|
|
Thanks for your reply. Here is a recap of the issue I am having:
"when using relationships (e.g. assignment/name) on my generator.yml, I just get the title of my module (e.g. parcel list) and the rest of the page is blank.. everything works fine when i am not using relationships.." (see sfExtjsThemePlugin.JPG) in the attached .rar file.
Here are the exact steps to replicate the issue:
1. Create a new project
2. Modify databases.yml and propel.ini to connect to any database
example: (databases.yml)
all:
propel:
class: sfPropelDatabase
param:
dsn: mysql://root:p455w0rd@localhost/symfony_test
example: (propel.ini - modified lines 5, 6, and 7)
propel.database.createUrl = mysql://root:p455w0rd@localhost/symfony_test
propel.database.url = mysql://root:p455w0rd@localhost/symfony_test
propel.mysql.tableType = InnoDB
3. Install sfExtjsThemePlugin and sfExtjs2Plugin
4. Extract the .rar file and copy over the contents to the newly created project directory (this should overwrite existing config, data, and apps folders)
5. Do a "symfony-propel-build-all-load frontend" command
*** the rar files contain my schema.yml and generator.yml for my assignments and parcels
Again, everything works fine if there are no relationships used.. thanks so much in advance..
|
|
| | | |
Goto Forum:
|