Page 1 of 1

[SOLVED] Come aumentare righe con CreateInputSelectList?

Posted: Mon Jun 22, 2009 7:28 pm
by nervino
Ciao a tutti,
sto cercando di modificare una SelectList del modulo Products che viene generata con il seguente codice:

if( count($catarray) > 0 )
 {
   $smarty->assign('input_categories',
     $this->CreateInputSelectList($id,'categories[]',$catarray));
 }

Le API dicono:

Code: Select all


CreateInputSelectList ($id, $name, $items, $selecteditems=array(), $size=3, $addttext='', $multiple=true, $html_id= '')

ho provato quindi a specificare SIZE così (ed in molti altri modi, aggiungendo virgole, apici ecc.):

Code: Select all

$this->CreateInputSelectList($id,'categories[]',$catarray, , 20));
ma non funziona o mi dà errore.

Qualcuno può spiegarmi come si fa?

grazie.

Re: Come aumentare righe con CreateInputSelectList?

Posted: Mon Jun 22, 2009 8:06 pm
by alby
Strano, dovrebbe andare bene

Alby

Re: Come aumentare righe con CreateInputSelectList?

Posted: Wed Jun 24, 2009 9:41 am
by nervino
Ho fatto altre prove. Eccole coi risultati:

$this->CreateInputSelectList($id,'categories[]',$catarray,20));

Code: Select all


Warning: in_array() [function.in-array]: Wrong datatype for second argument in
 /web/htdocs/www.toner-print.com/home/lib/classes/module_support/modform.inc.php on line 362


$this->CreateInputSelectList($id,'categories[]',$catarray, ,20));

Code: Select all


Parse error: syntax error, unexpected ',' in
 /web/htdocs/www.toner-print.com/home/modules/Products/action.addproduct.php on line 355



$this->CreateInputSelectList($id,'categories[]',$catarray, '',20));

Code: Select all


Warning: in_array() [function.in-array]: Wrong datatype for second argument in
 /web/htdocs/www.toner-print.com/home/lib/classes/module_support/modform.inc.php on line 362

Ma si vedono le 20 righe..!


In modform.inc.php on line 362 c'è: if (in_array($value, $selecteditems))

Mi sono arenato..

Re: Come aumentare righe con CreateInputSelectList?

Posted: Wed Jun 24, 2009 11:55 am
by alby
nervino wrote: Mi sono arenato..
Non mi ero accorto che non avevi messo niente fra le virgole.
Prova:
$this->CreateInputSelectList($id,'categories[]',$catarray, array(), 20));

Alby

Re: Come aumentare righe con CreateInputSelectList?

Posted: Wed Jun 24, 2009 3:54 pm
by nervino
Oppela! Eccolo che va alla grande.

Quindi gli passo un array vuoto e la funzione è contenta..?

Grazie Alby!

Re: [SOLVED] Come aumentare righe con CreateInputSelectList?

Posted: Fri Aug 21, 2009 9:58 pm
by Duketown
Thanks Alby,

Just the solution I was looking for.

Duketown