Yii Framework Forum: [ASK] JAppendo - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[ASK] JAppendo Please help me Rate Topic: -----

#1 User is offline   aponx son conx 

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

Posted 24 May 2012 - 08:17 AM

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 ?>">
<caption>
Status Tanah
</caption>
<thead>
<tr>
<th>Status Tanah</th>
<th>Luas</th>
</tr>
</thead>
<tbody>
<?php if ($model5->id_periode == null): ?>
<tr>
<td>
<?php echo CHtml::dropDownList('status[]',"1",
array(
"1"=>"Tanah Milik Bersertifikat",
"2"=>"Tanah Milik Belum Bersertifikat",
),array('style'=>'width:100px')
);
?>
</td>
<td><?php echo CHtml::textField('luas[]','',array('style'=>'width:310px')); ?></td>
</tr>
<?php else: ?>
<?php for($i = 0; $i < sizeof($model5->id_periode); ++$i): ?>
<tr>
<td>
<?php echo CHtml::dropDownList('status[]',$model5->status[$i],
array(
"1"=>"Tanah Milik Bersertifikat",
"2"=>"Tanah Milik Belum Bersertifikat",
),array('style'=>'width:100px')
);
?>
</td>
<td><?php echo CHtml::textField('luas[]',$model5->luas[$i],array('style'=>'width:310px')); ?></td>
</tr>
<?php endfor; ?>
<tr>
<td>
<?php echo CHtml::dropDownList('status[]',"1",
array(
"1"=>"Tanah Milik Bersertifikat",
"2"=>"Tanah Milik Belum Bersertifikat",
),array('style'=>'width:100px')
);
?>
</td>
<td><?php echo CHtml::textField('luas[]','',array('style'=>'width:310px')); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>

ini sintag di form...
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'statustanah-form',
'enableAjaxValidation'=>false,
)); ?>
<br><br>
<h3 align="center"><b>A. Bidang Pemerintahan</b></h3><br>
<h4><b>II. PERTANAHAN</b></h4>
<h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Status Tanah</h5>

<?php echo $form->errorSummary($model5); ?>

<div class="row">
<?php $this->widget('ext.appendo.JAppendo',array(
'id' => 'repeateStatus',
'model' => $model5,
'viewName' => 'enumerations',
'labelDel' => 'Remove Row'
//'cssFile' => 'css/jquery.appendo2.css'
)); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model5->isNewRecord ? 'Create' : 'Save' ); ?>
</div>
<?php $this->endWidget(); ?>

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

#2 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 08 May 2013 - 12:33 AM

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
0

Share this topic:


Page 1 of 1
  • 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