[ASK] JAppendo

Agan2 dan mastah2 semua…

Saya mau tanya nih.

Kenapa ya jappendo saya yang kedetek cuma 1 row aja dan inputannya jadi luas=1 dan status=1?

please help me…

dah mentok nih.

:(

ini sintag di controller …

if(isset($_POST[‘status’]))

	{	


		session_start();


		$model5->status=(int)$_POST['status'];


		$model5->luas=(int)$_POST['luas'];


		$idp = $_SESSION['id_periode'];


		$model5->id_periode = $idp;


		if($model5->save()){


			echo 'Selamat Anda Berhasil';


		}


	}

Ini sintag di enumerations…

<table class="appendo-gii" id="<?php echo $id ?>">

&lt;caption&gt;


Status Tanah


&lt;/caption&gt;


&lt;thead&gt;


	&lt;tr&gt;


		&lt;th&gt;Status Tanah&lt;/th&gt;


        &lt;th&gt;Luas&lt;/th&gt;


	&lt;/tr&gt;


&lt;/thead&gt;


&lt;tbody&gt;


&lt;?php if (&#036;model5-&gt;id_periode == null): ?&gt;


	&lt;tr&gt;


        &lt;td&gt;


        &lt;?php echo CHtml::dropDownList('status[]',&quot;1&quot;,


            array(


				&quot;1&quot;=&gt;&quot;Tanah Milik Bersertifikat&quot;,


                &quot;2&quot;=&gt;&quot;Tanah Milik Belum Bersertifikat&quot;,


			),array('style'=&gt;'width:100px')


            );


        ?&gt;


        &lt;/td&gt;


        &lt;td&gt;&lt;?php echo CHtml::textField('luas[]','',array('style'=&gt;'width:310px')); ?&gt;&lt;/td&gt;


	&lt;/tr&gt;


&lt;?php else: ?&gt;


    &lt;?php for(&#036;i = 0; &#036;i &lt; sizeof(&#036;model5-&gt;id_periode); ++&#036;i): ?&gt;


		&lt;tr&gt;


		&lt;td&gt;


        &lt;?php echo CHtml::dropDownList('status[]',&#036;model5-&gt;status[&#036;i],


            array(


				&quot;1&quot;=&gt;&quot;Tanah Milik Bersertifikat&quot;,


                &quot;2&quot;=&gt;&quot;Tanah Milik Belum Bersertifikat&quot;,


			),array('style'=&gt;'width:100px')


            );


        ?&gt;


        &lt;/td&gt;


            &lt;td&gt;&lt;?php echo CHtml::textField('luas[]',&#036;model5-&gt;luas[&#036;i],array('style'=&gt;'width:310px')); ?&gt;&lt;/td&gt;


		&lt;/tr&gt;


    &lt;?php endfor; ?&gt;


	&lt;tr&gt;


		&lt;td&gt;


        &lt;?php echo CHtml::dropDownList('status[]',&quot;1&quot;,


            array(


				&quot;1&quot;=&gt;&quot;Tanah Milik Bersertifikat&quot;,


                &quot;2&quot;=&gt;&quot;Tanah Milik Belum Bersertifikat&quot;,


			),array('style'=&gt;'width:100px')


            );


        ?&gt;


        &lt;/td&gt;


       &lt;td&gt;&lt;?php echo CHtml::textField('luas[]','',array('style'=&gt;'width:310px')); ?&gt;&lt;/td&gt;


	&lt;/tr&gt;


&lt;?php endif; ?&gt;


&lt;/tbody&gt;

</table>

ini sintag di form…

<div class="form">

<?php $form=$this->beginWidget(‘CActiveForm’, array(

'id'=&gt;'statustanah-form',


'enableAjaxValidation'=&gt;false,

)); ?>

<br><br>

&lt;h3 align=&quot;center&quot;&gt;&lt;b&gt;A. Bidang Pemerintahan&lt;/b&gt;&lt;/h3&gt;&lt;br&gt;


&lt;h4&gt;&lt;b&gt;II. PERTANAHAN&lt;/b&gt;&lt;/h4&gt;


&lt;h5&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1. Status Tanah&lt;/h5&gt;





&lt;?php echo &#036;form-&gt;errorSummary(&#036;model5); ?&gt;





&lt;div class=&quot;row&quot;&gt;


&lt;?php &#036;this-&gt;widget('ext.appendo.JAppendo',array(


    'id' =&gt; 'repeateStatus',        


    'model' =&gt; &#036;model5,


    'viewName' =&gt; 'enumerations',


    'labelDel' =&gt; 'Remove Row'


    //'cssFile' =&gt; 'css/jquery.appendo2.css'


)); ?&gt;


&lt;/div&gt;


&lt;div class=&quot;row buttons&quot;&gt;


	&lt;?php echo CHtml::submitButton(&#036;model5-&gt;isNewRecord ? 'Create' : 'Save' ); ?&gt;


&lt;/div&gt;

<?php $this->endWidget(); ?>

</div><!-- form -->

gan,

lain kali klo mau posting, kodingan tolong di masukin ke tag CODE

biar yg mw kasih solusi bisa lbh mudah buat baca kodingan agan. . .

mgkn salahny disini gan,




<?php echo CHtml::dropDownList('status[]',"1",

array(

"1"=>"Tanah Milik Bersertifikat",

"2"=>"Tanah Milik Belum Bersertifikat",

),array('style'=>'width:100px')

);

?>



coba diganti seperti ini :




<?php echo CHtml::dropDownList('status[]',"string",

array(

"1"=>"Tanah Milik Bersertifikat",

"2"=>"Tanah Milik Belum Bersertifikat",

),array('style'=>'width:100px')

);

?>



karena mengembalikan nilai string untuk tiap valueny. . .

CMIIW