[SOLVED] Come aumentare righe con CreateInputSelectList?

La discussione sul CMS Made Simple in italiano.

Moderator: magallo

Post Reply
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

[SOLVED] Come aumentare righe con CreateInputSelectList?

Post 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.
Last edited by nervino on Sat Jun 27, 2009 7:54 am, edited 1 time in total.
alby

Re: Come aumentare righe con CreateInputSelectList?

Post by alby »

Strano, dovrebbe andare bene

Alby
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

Re: Come aumentare righe con CreateInputSelectList?

Post 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..
alby

Re: Come aumentare righe con CreateInputSelectList?

Post 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
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

Re: Come aumentare righe con CreateInputSelectList?

Post by nervino »

Oppela! Eccolo che va alla grande.

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

Grazie Alby!
Duketown

Re: [SOLVED] Come aumentare righe con CreateInputSelectList?

Post by Duketown »

Thanks Alby,

Just the solution I was looking for.

Duketown
Post Reply

Return to “Italian - Italiano”