Add widths to columns
parent
8c9227849b
commit
8556e83fbb
|
@ -14,17 +14,17 @@
|
|||
<h5>Basic Cell Editing</h5>
|
||||
<p>Simple editors with v-model.</p>
|
||||
<DataTable :value="products1" editMode="cell" class="editable-cells-table" responsiveLayout="scroll">
|
||||
<Column field="code" header="Code">
|
||||
<Column field="code" header="Code" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="name" header="Name">
|
||||
<Column field="name" header="Name" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="inventoryStatus" header="Status">
|
||||
<Column field="inventoryStatus" header="Status" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<Dropdown v-model="slotProps.data['inventoryStatus']" :options="statuses" optionLabel="label" optionValue="value" laceholder="Select a Status">
|
||||
<template #option="slotProps">
|
||||
|
@ -36,7 +36,7 @@
|
|||
{{getStatusLabel(slotProps.data.inventoryStatus)}}
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="price" header="Price">
|
||||
<Column field="price" header="Price" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<h5>Advanced Cell Editing</h5>
|
||||
<p>Custom implementation with validations, dynamic columns and reverting values with the escape key.</p>
|
||||
<DataTable :value="products2" editMode="cell" @cell-edit-complete="onCellEditComplete" class="editable-cells-table" responsiveLayout="scroll">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText :modelValue="slotProps.data[slotProps.column.props.field]" @update:modelValue="onCellEdit($event, slotProps)" />
|
||||
</template>
|
||||
|
@ -60,17 +60,17 @@
|
|||
<h5>Row Editing</h5>
|
||||
<DataTable :value="products3" editMode="row" dataKey="id" v-model:editingRows="editingRows"
|
||||
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel" responsiveLayout="scroll">
|
||||
<Column field="code" header="Code">
|
||||
<Column field="code" header="Code" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" autofocus />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="name" header="Name">
|
||||
<Column field="name" header="Name" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="inventoryStatus" header="Status">
|
||||
<Column field="inventoryStatus" header="Status" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<Dropdown v-model="slotProps.data['inventoryStatus']" :options="statuses" optionLabel="label" optionValue="value" placeholder="Select a Status">
|
||||
<template #option="slotProps">
|
||||
|
@ -82,12 +82,12 @@
|
|||
{{getStatusLabel(slotProps.data.inventoryStatus)}}
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="price" header="Price">
|
||||
<Column field="price" header="Price" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column :rowEditor="true" headerStyle="width:7rem" bodyStyle="text-align:center"></Column>
|
||||
<Column :rowEditor="true" style="width:10%; min-width:8rem" bodyStyle="text-align:center"></Column>
|
||||
</DataTable>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -102,17 +102,17 @@
|
|||
<h5>Basic Cell Editing</h5>
|
||||
<p>Simple editors with v-model.</p>
|
||||
<DataTable :value="products1" editMode="cell" class="editable-cells-table" responsiveLayout="scroll">
|
||||
<Column field="code" header="Code">
|
||||
<Column field="code" header="Code" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="name" header="Name">
|
||||
<Column field="name" header="Name" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="inventoryStatus" header="Status">
|
||||
<Column field="inventoryStatus" header="Status" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<Dropdown v-model="slotProps.data['inventoryStatus']" :options="statuses" optionLabel="label" optionValue="value" laceholder="Select a Status">
|
||||
<template #option="slotProps">
|
||||
|
@ -124,7 +124,7 @@
|
|||
{{getStatusLabel(slotProps.data.inventoryStatus)}}
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="price" header="Price">
|
||||
<Column field="price" header="Price" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
|
@ -136,7 +136,7 @@
|
|||
<h5>Advanced Cell Editing</h5>
|
||||
<p>Custom implementation with validations, dynamic columns and reverting values with the escape key.</p>
|
||||
<DataTable :value="products2" editMode="cell" @cell-edit-complete="onCellEditComplete" class="editable-cells-table" responsiveLayout="scroll">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText :modelValue="slotProps.data[slotProps.column.props.field]" @update:modelValue="onCellEdit($event, slotProps)" />
|
||||
</template>
|
||||
|
@ -148,17 +148,17 @@
|
|||
<h5>Row Editing</h5>
|
||||
<DataTable :value="products3" editMode="row" dataKey="id" v-model:editingRows="editingRows"
|
||||
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel" responsiveLayout="scroll">
|
||||
<Column field="code" header="Code">
|
||||
<Column field="code" header="Code" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" autofocus />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="name" header="Name">
|
||||
<Column field="name" header="Name" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="inventoryStatus" header="Status">
|
||||
<Column field="inventoryStatus" header="Status" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<Dropdown v-model="slotProps.data['inventoryStatus']" :options="statuses" optionLabel="label" optionValue="value" laceholder="Select a Status">
|
||||
<template #option="slotProps">
|
||||
|
@ -175,7 +175,7 @@
|
|||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column :rowEditor="true" headerStyle="width:7rem" bodyStyle="text-align:center"></Column>
|
||||
<Column :rowEditor="true" style="width: 10%;min-width:8rem" bodyStyle="text-align:center"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</code></pre>
|
||||
|
@ -322,17 +322,17 @@ export default {
|
|||
<h5>Basic Cell Editing</h5>
|
||||
<p>Simple editors with v-model.</p>
|
||||
<DataTable :value="products1" editMode="cell" class="editable-cells-table" responsiveLayout="scroll">
|
||||
<Column field="code" header="Code">
|
||||
<Column field="code" header="Code" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="name" header="Name">
|
||||
<Column field="name" header="Name" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="inventoryStatus" header="Status">
|
||||
<Column field="inventoryStatus" header="Status" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<Dropdown v-model="slotProps.data['inventoryStatus']" :options="statuses" optionLabel="label" optionValue="value" placeholder="Select a Status">
|
||||
<template #option="slotProps">
|
||||
|
@ -344,7 +344,7 @@ export default {
|
|||
{{getStatusLabel(slotProps.data.inventoryStatus)}}
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="price" header="Price">
|
||||
<Column field="price" header="Price" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
|
@ -356,7 +356,7 @@ export default {
|
|||
<h5>Advanced Cell Editing</h5>
|
||||
<p>Custom implementation with validations, dynamic columns and reverting values with the escape key.</p>
|
||||
<DataTable :value="products2" editMode="cell" @cellEditComplete="onCellEditComplete" class="editable-cells-table" responsiveLayout="scroll">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field" style="width:25%">
|
||||
<template #editor="slotProps">
|
||||
<InputText :modelValue="slotProps.data[slotProps.column.props.field]" @update:modelValue="onCellEdit($event, slotProps)" />
|
||||
</template>
|
||||
|
@ -368,17 +368,17 @@ export default {
|
|||
<h5>Row Editing</h5>
|
||||
<DataTable :value="products3" editMode="row" dataKey="id" v-model:editingRows="editingRows"
|
||||
@rowEditInit="onRowEditInit" @rowEditCancel="onRowEditCancel" responsiveLayout="scroll">
|
||||
<Column field="code" header="Code">
|
||||
<Column field="code" header="Code" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" autofocus />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="name" header="Name">
|
||||
<Column field="name" header="Name" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="inventoryStatus" header="Status">
|
||||
<Column field="inventoryStatus" header="Status" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<Dropdown v-model="slotProps.data['inventoryStatus']" :options="statuses" optionLabel="label" optionValue="value" laceholder="Select a Status">
|
||||
<template #option="slotProps">
|
||||
|
@ -390,12 +390,12 @@ export default {
|
|||
{{getStatusLabel(slotProps.data.inventoryStatus)}}
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="price" header="Price">
|
||||
<Column field="price" header="Price" style="width:20%">
|
||||
<template #editor="slotProps">
|
||||
<InputText v-model="slotProps.data[slotProps.column.props.field]" />
|
||||
</template>
|
||||
</Column>
|
||||
<Column :rowEditor="true" headerStyle="width:7rem" bodyStyle="text-align:center"></Column>
|
||||
<Column :rowEditor="true" style="width: 10%; min-width:8rem" bodyStyle="text-align:center"></Column>
|
||||
</DataTable>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue