Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a dynamic textfield inside a grdiview
    primarykey
    data
    text
    <pre><code>&lt;?php echo CHtml::beginForm('','post',array('id'=&gt;'base-si-received-item-form'));?&gt; &lt;?php $this-&gt;widget('zii.widgets.grid.CGridView', array( 'id'=&gt;'base-si-received-item-grid', 'dataProvider'=&gt;BaseRefSiDetails::model()-&gt;search(), //'filter'=&gt;$searchModel, 'columns'=&gt;array( array( 'class'=&gt;'CCheckBoxColumn', 'id'=&gt;'base-si-received-item-id', 'selectableRows'=&gt;2, // multiple rows can be selected ), array( 'name'=&gt;'unit', 'header'=&gt;'unit', 'type'=&gt;'raw', 'value'=&gt;'CHtml::textField(BaseSiReceivedItem::model()-&gt;quantity_received,"",array("id"=&gt;"received_quantity","name"=&gt;"quantity_received"))', ), array( 'name'=&gt;'unit', 'header'=&gt;'unit', 'type'=&gt;'raw', 'value'=&gt;'CHtml::dropDownlist(BaseSiReceivedItem::model()-&gt;unit,"unit",array("pc"=&gt;"pc","box"=&gt;"box"))' ), array( 'name'=&gt;'unit_cost', 'header'=&gt;'unit cost', 'type'=&gt;'raw', 'value'=&gt;'CHtml::textField(BaseSiReceivedItem::model()-&gt;unit_cost,"",array("id"=&gt;"unit_cost"))', ), array( 'name'=&gt;'total_cost', 'header'=&gt;'total cost', 'type'=&gt;'raw', 'value'=&gt;'CHtml::textField(BaseSiReceivedItem::model()-&gt;total_cost,"",array("id"=&gt;"total_cost","readonly"=&gt;"readonly"))', ), ) ) ?&gt; </code></pre> <p>I have a problem on my <strong>gridview</strong> .<br/> What I need to do is, when input a number of quantity received and unit cost, the price will automatically be shown on total cost. I have a <strong>jquery</strong> script to do that.<br/> My problem is the only first row are executing the codes :</p> <p>Here is my <strong>jquery</strong>:</p> <pre><code> $(document).ready( function(){ $("#unit_cost").keyup(function() { $("#total_cost").val($("#unit_cost").val() * $("#received_quantity").val()); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload