I have CGridview for showing list of product look like this
±------------------------------------------------+
|item id | item name | Order Qty | Unit |
±------------------------------------------------+
| 0001 | Product 001 | […] | KG. |
| 0002 | Product 002 | […] | Pg. |
| 0003 | Product 003 | […] | Pg. |
| 0004 | Product 004 | […] | Btl. |
| 0005 | Product 005 | […] | KG. |
±------------------------------------------------+
I need to input Order Qty when press enter<no need save button please>, data sending to server to save it by ajax and execute INSERT or UPDATE SQL.
Anyone have solutions?
my code is
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'secOrderGrid',
'ajaxUpdate'=>false,
'dataProvider' => $dataProvider->search($merge),
'filter'=>$dataProvider,
'enablePagination' => true,
'columns' => array(
array(
'name' => 'item_no',
'header' => 'Item Id',
'htmlOptions'=>array('style'=>'text-align: left; width:50px;'),
),
array(
'name' => 'item.item_name',
'header' => 'Item Name',
'htmlOptions'=>array('style'=>'text-align: left; width:350px;'),
),
array(
'header' => 'Quantity',
'type'=>'raw',
'value'=>'CHtml::textField("$data[item_no]","0",array("style"=>"width:40px;text-align:right;"))',
'htmlOptions'=>array('style'=>'text-align: center; width:10%;'),
),
array(
'name' => 'item.unit_code',
'header' => 'Unit',
'htmlOptions'=>array('style'=>'text-align: left; width:50px;'),
),
),
));
?>