handleUpdateRingers(index, event) {
this.setState({
items: update(this.state.items, {0: {ringerNumbers: {$set: event.target.value}}})
}, () => this.updateTotals())
如何在setState中删除0
的硬编码并使用索引来驱动它?
答案 0 :(得分:1)
将 <body>
<?php
$i=1;
foreach($data as $row)
{
?>
<form method="post" enctype="multipart/form-data">
<div class="container">
<h5 style="color:#ff1a1a">Select Section</h5>
<?php $array = array('Creative'=>'Creative','Photography'=>'Photography','Development'=>'Development');
echo form_multiselect('type[]',$array,$row->type);
?>
<span class="text-danger"><?php echo form_error("type");?></span><br><br>
<br><input type="submit" name="update" class="btn btn-success" value="Update Records"/>
</div>
</form>
<?php } ?>
</body>
用作index
的大括号括起来:
Object