title: Yii Grid, multiple management rows
body: <p>i have a questions about managament rows in grid. For example we have food/cost table like:</p>
  
  <pre><code>Fruit | cost
  ------------
  Apple | 10$
  Bannan| 5$
  </code></pre>
  
  <p>We can create form like:</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type='text' name='Fruits[0][fruit] value='Apple' /&gt; &lt;input type='text' name='Fruits[0][cost]  value='10$' /&gt; &lt;br&gt;
  &lt;input type='text' name='Fruits[1][fruit] value='Bannan' /&gt; &lt;input type='text' name='Fruits[1][cost]  value='5$' /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And save all it like:</p>
  
  <pre><code> if ($is_new)
      if(isset($_POST['Fruits'])) {
        foreach ($_POST['Fruits'] as $fruit) {
          $model = new Fruit();
          $model-&gt;attributes = $fruit;
          $model-&gt;save();
        }
      }
  } else { //here code for update, $model-&gt;load()... }
  </code></pre>
  
  <p>All fine, we can update both rows... But that if i want add new? All fine method above make all good, but what if i delete 1 row? In my base i will have 2 rows, but i need only 1.</p>
  
  <p>Here 2 ways i see:
  1. Delete all fruits from databse on every update when POST count != databse count
  2. We can load database rows, write loop, check every row... but its so hard, so many code...</p>
  
  <p>How you manage new and deleted rows?</p>