{assign var=i value=1}
{foreach $deviceInvests as $data}
<tr>
    <td>{$data.catName}</td>
    <td>{$data.invName}</td>
    <td>{$data.invest_child}</td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="send_code" 
               data-id="{$data.id}"   value="{$data.send_code}"   />
    </td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="receive_code" 
               data-id="{$data.id}"   value="{$data.receive_code}"   />
    </td>
    <td>
        <textarea  id="range_txt" class="form-control  updateElement"  
                   data-tableName="lab_devices_ranges" data-colName="range_txt" 
                   data-id="{$data.id}"   style="overflow-y: scroll;">
            {$data.range_txt}
        </textarea>
    </td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="range_low" 
               data-id="{$data.id}"   value="{$data.range_low}"   />
    </td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="range_high" 
               data-id="{$data.id}"   value="{$data.range_high}"   />
    </td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="invest_units" 
               data-id="{$data.id}"   value="{$data.invest_units}"   />
    </td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="agefrom" 
               data-id="{$data.id}"   value="{$data.agefrom}"   />
    </td>
    <td>
        <input type="text"  class="form-control   updateElement positivefloat"
               data-tableName="lab_devices_ranges" data-colName="ageto" 
               data-id="{$data.id}"   value="{$data.ageto}"   />
    </td>
    <td>
        <select class="form-control updateElement"   id="age_units" 
                data-tableName="lab_devices_ranges" data-colName="age_units" 
                data-id="{$data.id}">
            <option value=""></option>
            <option value="1"  {if $data.age_units == 1 }  selected  {/if}>Year</option>
            <option value="2" {if $data.age_units == 2 }  selected  {/if}>Month</option>
            <option value="3" {if $data.age_units == 3 }  selected  {/if}>Day</option>
            <option value="4" {if $data.age_units == 4 }  selected  {/if}>Hour</option>
            <option value="5" {if $data.age_units == 5 }  selected  {/if}>Minute</option>
            <option value="6" {if $data.age_units == 6 }  selected  {/if}>Second</option>
        </select>
    </td>
    <td>
        <select class="form-control updateElement"   id="gender" 
                data-tableName="lab_devices_ranges" data-colName="gender" 
                data-id="{$data.id}">
            <option value=""></option>
            <option value="-1"  {if $data.gender == -1 }  selected  {/if}>All</option>
            <option value="0" {if $data.gender == 0 }  selected  {/if}>F</option>
            <option value="1" {if $data.gender == 1 }  selected  {/if}>M</option>
        </select>
    </td>
    <td>
        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$data.id}" 
           style=" float: left;" href="#" data-link="{$controllname}" 
           data-fn="del" data-tableName="lab_devices_ranges">
            <i class="fa fa-close"></i>
        </a>
    </td>
</tr> 
{capture assign=i}{$i+1}{/capture}
{/foreach}