Yii Framework Forum: e-xgen extjs scafolding for admin - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

e-xgen extjs scafolding for admin extjs scafolding gii template based on giix extension by mentel Rate Topic: ***-- 3 Votes

#21 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 02 March 2012 - 07:17 AM

hi banago, first thx for testing my extension, first get the id of the master from extjs selection model, then reload the detail store like this

var record = this.sm.getSelections();
var id= record[0].json.id; 

detailStore.baseParams = {
	query: id
};

detailStore.reload(); 


i'm debuging with firebug in firefox

hope this help


View Postbanago, on 20 February 2012 - 07:29 AM, said:

Hi,
I've installed the e-xgen extension and it works well.
BTW - in my setup I had to use the following in config/main.php to make it work (and to allow the use of gii)
'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(

				'gii'=>'gii',
				'gii/<controller:\w+>'=>'gii/<controller>',
				'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>',

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		


I'm still a yii and extjs newbie and maybe you could answer me some questions:

I have the tables "Master" and a model "Detail" for which generated the code with GiixModel and GiixCrudjs Generator.
This works so far.
Now I have added the extjs code from the grid "Detail" to the form "Master".
The Detail grid is now displayed in the Master Form.
Now the tricky part...

I'm trying now to filter the Detail-grid in the Master-form to the records which belong to the masterform...

So I've changed the code in the DetailController to display only some records.

$model = Faktpos::model()->findAll($criteria);
to
$id=426;
$model = Detail::model()->with('Master')->findAll('MasterID=' . $id)


Question(s):
  • How shall I pass the id of the master record to the detail controller?
  • What do you use for debugging such issues? (How can I see what Yii is doing if I'm clicking on something on the extjs Gui?)
  • Or is there a simpler / better approach?


The Night Has Come to Hold Us Young - SmP
0

#22 User is offline   bosire 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 30-January 12

Posted 29 March 2012 - 08:59 PM

Hi,
I installed the yii user extension in the default generated webapp and enabled login to be my default controller and it works fine. However when i install e-xgen which is fantastic by the way and enable extjs theme, it doesnt load my login as default. Question:

1. How can I make login my default controller? In my main config,I did

return array(
	                 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	                 'name'=>'My Web Application',
                         'defaultController' => 'user/login',
                         'theme'=>'extjs',


It works when i disable the theme.

2. How can I implement the login screen with a custom extjs theme i.e apply e-xgen js?

3. How do you map/reference a column in a store eg make the grid display name instead of id? It displays o.k when i disable theme.

Thank you.
0

#23 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 29 March 2012 - 10:25 PM

To make login as a controller default youhave to apply different layout in extjs theme, for my private use, I have login layout and report layout that use yii standard theme it can be set in the controller $this->layout = login, create the layout in the extjs them by coppying standard yii main layout into extjs theme, to map field from I'd to name I have to see it first, currently I'm at the the airport, waiting for my first birth daughter..
The Night Has Come to Hold Us Young - SmP
0

#24 User is offline   bosire 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 30-January 12

Posted 30 March 2012 - 02:04 PM

View Posthening malam, on 29 March 2012 - 10:25 PM, said:

To make login as a controller default youhave to apply different layout in extjs theme, for my private use, I have login layout and report layout that use yii standard theme it can be set in the controller $this->layout = login, create the layout in the extjs them by coppying standard yii main layout into extjs theme, to map field from I'd to name I have to see it first, currently I'm at the the airport, waiting for my first birth daughter..


Thanks Hening. I did implement the login and it worked. However, I'm still having difficulty mapping id with name in grid. Lucky you have a princess in your life.Enjoy. :)
0

#25 User is offline   bosire 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 30-January 12

Posted 02 April 2012 - 05:24 AM

Hi,
How are you? I was wondering if you managed to map id to name in grip as am still having difficulty with it but am having a great learning experience using e-xgen. I've tried

in the store:
{name:'date'},
{name:'rvc_id', mapping: 'rvc.id',type:'int'},
{name:'postingcat_id', mapping: 'postingcat.id', type: 'int'},
{name:'sales'},


where both rvc_id and postingcat_id are foreign keys and
in the grid:
{
      header:'Revenue Centre',
      sortable:true,
      resizable:true,  	             
      dataIndex:'rvc_id',                   
      displayField: 'name',
      value: 'id',
      align: 'left',
      width:140
},

but it still displaying id not name. In the form i.e xtype: combo it shows the name o.k. I been busting my head off with this for sometime now but am still stuck. Attached is my screen shot.

Secondly, how can you relate two dropdowns in a form such that when you pick an option in the first combo, the 2nd selects only related choices?
{
      xtype: 'combo',
      typeAhead: true,
      triggerAction: 'all',
      lazyRender:true,
      mode: 'local',                            
      fieldLabel: 'Revenue Centre',
      store: jun.rztrvc,
      hiddenName:'rvc_id',
      hiddenValue:'rvc_id',
      valueField: 'id',
      editable: false,
      selectOnFocus: true,
      //displayField: 'Rvc::model()->representingColumn()',
      displayField: 'name',
      //allowBlank:false,
      anchor: '100%'
               
 }, 
 {
      xtype: 'combo',
      typeAhead: true,
      triggerAction: 'all',
      lazyRender:true,
      editable: false,
      selectOnFocus: true,
      mode: 'local',                            
      fieldLabel: 'Posting Category',
      store: jun.rztPostingcat,
      hiddenName:'postingcat_id',
      hiddenValue:'postingcat_id',
      valueField: 'id',
      //displayField: Postingcat::model()->representingColumn()',
      displayField: 'postingcat_name',
      //allowBlank:false,
      anchor: '100%'
  }, 

I totally love this extension. everyday is a learning experience. For all yiiers out there wanting to building applications that look more like applications and not sites, this is the extension for you.
Thank you.

Attached File(s)


0

#26 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 02 April 2012 - 07:44 AM

hi bosiree, in order to mapping name to id, i guest i have to edit my giix gridjs template, but i can't promise u to do that in the near time.. or you could help me, you can find quick sample in the form template, when i map id to name in the combo.

to make double linked combo create listener or add new method on new combo 1 even on change, pass the id to extjs.ajax to call store combo2 load with combo1 i as parameter

View Postbosire, on 02 April 2012 - 05:24 AM, said:

Hi,
How are you? I was wondering if you managed to map id to name in grip as am still having difficulty with it but am having a great learning experience using e-xgen. I've tried

in the store:
{name:'date'},
{name:'rvc_id', mapping: 'rvc.id',type:'int'},
{name:'postingcat_id', mapping: 'postingcat.id', type: 'int'},
{name:'sales'},


where both rvc_id and postingcat_id are foreign keys and
in the grid:
{
      header:'Revenue Centre',
      sortable:true,
      resizable:true,  	             
      dataIndex:'rvc_id',                   
      displayField: 'name',
      value: 'id',
      align: 'left',
      width:140
},

but it still displaying id not name. In the form i.e xtype: combo it shows the name o.k. I been busting my head off with this for sometime now but am still stuck. Attached is my screen shot.

Secondly, how can you relate two dropdowns in a form such that when you pick an option in the first combo, the 2nd selects only related choices?
{
      xtype: 'combo',
      typeAhead: true,
      triggerAction: 'all',
      lazyRender:true,
      mode: 'local',                            
      fieldLabel: 'Revenue Centre',
      store: jun.rztrvc,
      hiddenName:'rvc_id',
      hiddenValue:'rvc_id',
      valueField: 'id',
      editable: false,
      selectOnFocus: true,
      //displayField: 'Rvc::model()->representingColumn()',
      displayField: 'name',
      //allowBlank:false,
      anchor: '100%'
               
 }, 
 {
      xtype: 'combo',
      typeAhead: true,
      triggerAction: 'all',
      lazyRender:true,
      editable: false,
      selectOnFocus: true,
      mode: 'local',                            
      fieldLabel: 'Posting Category',
      store: jun.rztPostingcat,
      hiddenName:'postingcat_id',
      hiddenValue:'postingcat_id',
      valueField: 'id',
      //displayField: Postingcat::model()->representingColumn()',
      displayField: 'postingcat_name',
      //allowBlank:false,
      anchor: '100%'
  }, 

I totally love this extension. everyday is a learning experience. For all yiiers out there wanting to building applications that look more like applications and not sites, this is the extension for you.
Thank you.

The Night Has Come to Hold Us Young - SmP
0

#27 User is offline   agus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 16-July 13

Posted 09 December 2013 - 11:31 PM

bagaimana ya cara nya membuat user login ?

thanks
0

#28 User is offline   Racw 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 12-May 14

Posted 19 May 2014 - 04:35 AM

Error
Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\testing\protected\extensions\giix-core\giixCrudjs\templates\default\layouts\grid.js on line 126

When generating with giixcrudjs. Any Solution?
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users