<div style="display: inline">
    <select class="select2 wdt300 productCat_re productCat_re{$itr}" style="width:30%;display: inline" data-itr ="{$itr}" data-level="{$level}"  name="productCatId_re{$level}_{$itr}" id="productCatId_re{$level}_{$itr}" >
        <option value="-1">اختر تصنيف</option>
        {foreach $catDataReport as $data}
        <option value="{$data->productCatId}">{$data->productCatName}</option>
        {/foreach}
    </select>
</div>
<div id="tempdiv">
    <input type="hidden" id="level_temp" value="{$level}"/>
    <input type="hidden" id="itr_temp" value="{$itr}"/>
</div>
{literal}
<script>
    var levelhere = $('#level_temp').val();
    var itrhere = $('#itr_temp').val();
    $('#productCatId_re' + levelhere + '_' + itrhere + '').select2();
    $('#tempdiv').remove();
</script>
{/literal}