<![CDATA[ [Problem] ModExt combo box [semi-solved] left join query problem [solved] - My Forums]]> https://forums.modx.com/thread/?thread=18738 <![CDATA[Re: [Problem] ModExt combo box [semi-solved] left join query problem [unsolved]]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved?page=2#dis-post-102759
$c = $modx->newQuery('Indication'); 
$c->bindGraph('{"IndicationType":{}}');

$c->sortby($sort,$dir); 

$indications = $modx->getCollectionGraph('Indication', '{"IndicationType":{}}', $c);


Hope it is fast enought and don’t slow my web...]]>
TheBoxer Feb 20, 2011, 12:26 PM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved?page=2#dis-post-102759
<![CDATA[Re: [Problem] ModExt combo box [semi-solved] left join query problem [unsolved]]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved?page=2#dis-post-102758
$modx->log(modX::LOG_LEVEL_ERROR, $c->toSql());


This will show the generated SQL statement in the MODx error log in the manager.

Take it from there to see whether your query runs as expected in PHPMYADMIN or equivalent.]]>
skndn60 Feb 20, 2011, 12:18 PM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved?page=2#dis-post-102758
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102757
and I got one more problem in SQL query...
want query like: "SELECT Indication.name, IndicationType.name FROM Indication LEFT JOIN IndicationType ON Indication.indication_type = IndicationType.id"

and parse it by the chunk, outpu should look like "Indication name - Indication type name"

my sql syntax in modx is:
$c = $modx->newQuery('Indication'); 
$c->select('Indication.*', 'IndicationType.name');
$c->leftJoin('IndicationType', 'IndicationType', 'Indication.indication_type = IndicationType.id');
$c->sortby($sort,$dir); 
$indications = $modx->getCollection('Indication',$c);

foreach ($indications as $indication) { 
    $indicationArray = $indication->toArray();
    $output .= $indi->getChunk($tpl,$indicationArray); 
   
}

return $output; 


But I don’t know how to get the IndicationType.name ....

my chunk look like
<li><strong>[[+name]]</strong> - [[+IndicationType.name]]</li>


but it shows me only indication name, and name of type is empty :-/

(no error)]]>
TheBoxer Feb 20, 2011, 08:49 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102757
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102756
Do you use Chrome Javascript debugger or Firefox’s Firebug?

They should quickly point out the problem with your code.]]>
skndn60 Feb 20, 2011, 07:57 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102756
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102755
and second problem, in my grid is showed id... want name there :-/ when i double clicked combo appears well and works well, but in grid is id sad -- this sovled ,renderer: true smiley]]>
TheBoxer Feb 20, 2011, 04:13 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102755
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102754 shamblett Feb 20, 2011, 03:58 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102754 <![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102753 look arond to others commponent and try something and its working smiley

my combo box is look like:
Indications.combo.Type = function(config){
	config = config || {};
	
	Ext.applyIf(config,{
		hiddenName: 'id',
		displayField: 'name',
		valueField: 'id',
		fields: ['id','name'],
		url: Indications.config.connectorUrl,
		baseParams: { action: 'mgr/indication/getComboList' },
	});

	Indications.combo.Type.superclass.constructor.call(this,config);
};
Ext.extend(Indications.combo.Type,MODx.combo.ComboBox);
Ext.reg('indications-combo-type',Indications.combo.Type);


and i added processor file
<?php                   

$c = $modx->newQuery('IndicationType'); 

$indications = $modx->getIterator('IndicationType', $c); 
  
/* iterate */
$list = array(); 
foreach ($indications as $indication) { 
    $indicationArray = $indication->toArray(); 
    $list[]= $indicationArray; 
} 
return $this->outputArray($list);


and delete that connector I posted here before smiley and it works fine...

last task is to preselect first value... smiley anyone know how?]]>
TheBoxer Feb 20, 2011, 03:33 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102753
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102752
Notice: Undefined variable: modx in D:\Web\www\modx\assets\components\indications\connector-type.php on line 4 Fatal error: Call to a member function newQuery() on a non-object in D:\Web\www\modx\assets\components\indications\connector-type.php on line 4


I added theese lines (they are in connector.php file)
require_once dirname(dirname(dirname(dirname(__FILE__)))).'/config.core.php'; 
require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php'; 
require_once MODX_CONNECTORS_PATH.'index.php';


and now i am getting this error:
Fatal error: Using $this when not in object context in D:\Web\www\modx\assets\components\indications\connector-type.php on line 16


connector-type.php file:
<?php                   
require_once dirname(dirname(dirname(dirname(__FILE__)))).'/config.core.php'; 
require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php'; 
require_once MODX_CONNECTORS_PATH.'index.php';    

$c = $modx->newQuery('IndicationType'); 

$indications = $modx->getIterator('IndicationType', $c); 
  
/* iterate */
$list = array(); 
foreach ($indications as $indication) { 
    $indicationArray = $indication->toArray(); 
    $list[]= $indicationArray; 
} 
return $this->outputArray($list);
]]>
TheBoxer Feb 20, 2011, 03:10 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102752
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102751 ’/assets/components/indications/connector-type.php’ ie your connector, what do you get returned?
]]>
shamblett Feb 20, 2011, 03:00 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102751
<![CDATA[Re: [Problem] ModExt my combo box doesn't working (i am beginner with this)]]> https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102750 thx for reply,

I used my defined xtype in my window...
,{ 
            fieldLabel: _('indications.nameType') 
            ,name: 'indication_type'
            ,width: 300 
            ,xtype: 'indications-combo-type' 
        }]


When I open the window, the combo box is there, but without values :-/

How to store them in different files and where I should include them?]]>
TheBoxer Feb 20, 2011, 02:35 AM https://forums.modx.com/thread/18738/problem-modext-combo-box-semi-solved-left-join-query-problem-solved#dis-post-102750