<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.product_product.master_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('name')">
                <el-table-column show-overflow-tooltip :prop="'name'" :label="$t('entities.product_product.master_grid.columns.name')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.name')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.name}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('default_code')">
                <el-table-column show-overflow-tooltip :prop="'default_code'" :label="$t('entities.product_product.master_grid.columns.default_code')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.default_code')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.default_code}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('attribute_value_ids')">
                <el-table-column show-overflow-tooltip :prop="'attribute_value_ids'" :label="$t('entities.product_product.master_grid.columns.attribute_value_ids')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.attribute_value_ids')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.attribute_value_ids}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('list_price')">
                <el-table-column show-overflow-tooltip :prop="'list_price'" :label="$t('entities.product_product.master_grid.columns.list_price')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.list_price')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.list_price}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('standard_price')">
                <el-table-column show-overflow-tooltip :prop="'standard_price'" :label="$t('entities.product_product.master_grid.columns.standard_price')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.standard_price')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.standard_price"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('qty_available')">
                <el-table-column show-overflow-tooltip :prop="'qty_available'" :label="$t('entities.product_product.master_grid.columns.qty_available')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.qty_available')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.qty_available"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('virtual_available')">
                <el-table-column show-overflow-tooltip :prop="'virtual_available'" :label="$t('entities.product_product.master_grid.columns.virtual_available')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.virtual_available')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.virtual_available"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('uom_name')">
                <el-table-column show-overflow-tooltip :prop="'uom_name'" :label="$t('entities.product_product.master_grid.columns.uom_name')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.product_product.master_grid.columns.uom_name')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.uom_name}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>