Closed chneqiang closed 3 years ago
@van-huyen for copy/pase behaviour use beforeautofill
or use readonly
mode
Oh thank @Super-Chama ,
if use readonly mode, we can not control disable/enable input for each cell like this question. i tried used beforeautofill but it not handle behavior Ctrl + V. i'm still finding what is the event of Ctrl + V on Revo-Grid 😃 so i'm disabling clipboard func.
Regards!
You can use the readonly
flag. It's an attribute
(use on VueComponent <revo-grid readonly="true">
for all cells), as well as a property
(use on data source
for selected cells only).
@franz-josef-kaiser @Super-Chama @revolist is it possible to make a single column editable and others will be only in readOnly mode, till now i just use readOnly but it makes the whole table readOnly mode, but i want a type of attribute that works as per column.
Lo que ise para poder realizar esto, es agregar una propiedad llamado editable, despues en el componente ejecute el evento @beforeeditstart y luego recorro el arreglo de cuales tiene editable, y a esas le agrego e.preventDefault();
Columns
{
prop: "delete",
name: "",
size: 80,
cellTemplate: VGridVueTemplate(BtnDeleteComp),
editable: false,
},
Template
<VGrid
ref="VGridRef"
theme="material"
style="height: 100%"
:source="tableData"
:columns="columns"
:auto-size-column="false"
:resize="true"
:exporting="true"
:readonly="false"
@beforeeditstart="beforeEditStart"
></VGrid>
Function
function beforeEditStart(e) {
let propsNoEditable = [];
for (let index = 0; index < columns.length; index++) {
if (
columns[index].editable !== undefined &&
columns[index].editable === false
) {
propsNoEditable.push(columns[index].prop);
}
}
if (propsNoEditable.includes(e.detail.prop)) {
e.preventDefault();
}
}
Esto lo realize por q no me gustaba que se viera opaco la imagen que tenia al ponerle readonly
I want to control that some cells are not editable