Why is it not stored in the session strage when I add columns to the MultiSection box?

UI Components for Vue
Post Reply
asdffdsa
Posts: 3
Joined: 09 Feb 2021, 04:15

01 Apr 2021, 03:12

Why is it not stored in the session strage when I add columns to the MultiSection box? Also, how do I save it?
This is my code.

Code: Select all

                    <DataTable ref="dt" :value="datas" 
                            :lazy="true" :paginator=true :rows="20" :totalRecords="totalRecords" :first="first" @page="onPage($event)"
                            paginatorTemplate="CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
                            :rowsPerPageOptions="[20,40,60,100]"
                            currentPageReportTemplate="Showing {first} to {last} of {totalRecords}"
                            v-model:selection="selectedProducts" dataKey="id"
                            stateStorage="local" stateKey="columnSession"
                            :reorderableColumns="true"
                            >
                     	<template #header>
                          <Button label="edit" @click="multiEdit()"/>
                          <Button label="add"/>
                          <Button label="add"/>
                          <Button label="add"/>
                          <MultiSelect v-model="defalutSeletion" :modelValue="selectedColumns" :options="columns" optionLabel="header" :multiple="true" display="chip" @update:modelValue="onToggle" dataKey="id"
                          placeholder="Select Columns" style="width: 20em"/>
                          <InputText ref="searchBox" v-model="searchText" @keydown.enter="onFilter()" placeholder="Keyword Search" />
                          <Button label="clear" @click="clearFilters()"/>
                        </template>
                        <template #empty>
                           No Data.
                        </template>
                        <template #loading>
                           Loading data. Please wait.
                      </template>
                      <Column selectionMode="multiple" headerStyle="width: 3em" frozen="true" alignFrozen="left" reorderableColumn="false"></Column>
                      <Column v-for="(col, index) of selectedColumns" :ref="setItemRef" :field="col.field" :header="col.header" :key="col.field">
                        <template #body="slotProps">
                          <div v-if="col.field === 'product_number'" v-html="renderDatas(slotProps)" :ref="testRefs" @click="singleEdit(slotProps.data)"></div>
                          <div v-else v-html="renderDatas(slotProps)" :ref="testRefs" ></div>
                        </template>
                      </Column>
                    </DataTable>

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests