[Custom Components] Unable to update inherited editform values
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- angular, typescript
- Área
- frontend
Línea de trabajo
Comienza desde el punto de entrada heredado Components.components.radio.editForm y reproduce la sobrescritura personalizada de values con las versiones de Formio y Angular indicadas. Rastrea cómo se combinan las propiedades del formulario de edición padre y del hijo, y verifica después que campos como label y reorder se actualicen en el padre, mientras las sobrescrituras existentes del hijo siguen funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment:
formiojs: ^4.14.1
formio/angular : ^5.3.0-rc.2
angular:13.3.11
I'm making a custom radio component, inheriting the radio editFormfrom formio, as an example below:
import { Components } from 'formiojs';
const COMPONENT_OPTIONS: FormioCustomComponentInfo = {
type: 'custom-radio',
selector: 'custom-radio',
title: 'Radio',
group: 'basic',
icon: 'stop-circle-o',
editForm: Components.components.radio.editForm, <----------------------
schema: {tableView: true},
fieldOptions: ['key', 'label', 'values','value', 'disabled', 'validate']
};
The base code equivalent of the values field is as follows:
{
"type": "datagrid",
"input": true,
"label": "Values",
"key": "values",
"tooltip": "The radio button values that can be picked for this field. Values are text submitted with the form data. Labels are text that appears next to the radio buttons on the form.",
"weight": 10,
"reorder": true,
"defaultValue": [
{
"label": "",
"value": ""
}
],
"components": [
{
"label": "Label",
"key": "label",
"input": true,
"type": "textfield"
},
{
"label": "Value",
"key": "value",
"input": true,
"type": "textfield",
"allowCalculateOverride": true,
"calculateValue": "value = _.camelCase(row.label);",
"validate": {
"required": true
}
},
{
"type": "select",
"input": true,
"weight": 180,
"label": "Shortcut",
"key": "shortcut",
"tooltip": "The shortcut key for this option.",
"dataSrc": "custom",
"valueProperty": "value",
"template": "{{ item.label }}",
"data": {}
}
]
}
In the editform of my custom component I'm doing this:
{
key: "values",
label: "test", //not working
reorder: false, //not working
components: [
{
key: "shortcut",
ignore: true, //working
},
{
key: "value",
label: "test2", //working
}
],
calculateValue(context) {
console.log(context.value); //working
return context.value;
}
}
However, no changes to the parent component (values) are reflected.
What I managed to change was the child components.
How can I modify data, such as label, reorder, among others of the parent component?
- Lenguaje dominante
- TypeScript
- Estrellas
- 706
- Forks
- 493
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de formio/angular
-
[Question] Angular 22 Update?Abiertoquestion
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
[BUG] <form-builder> move icon is missingQuizá libre de nuevo @PrathameshHegde la tomó hace 99 días y no hay ningún pull request abierto. Abiertobug
-
[Question] Version 10.0Abiertoquestion
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
-
[BUG] "Left (Right-aligned)" label position causes misaligned error messages and descriptionsQuizá libre de nuevo @Victoriya25 la tomó hace 363 días y no hay ningún pull request abierto. Abiertobug
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de formio/angular
Issues similares
-
bot:ai-assisted component:platform-js status:untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
midnightntwrk/platform-js#38 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ranxianglei/billion-context#7068 ·
Los mantenedores suelen responder en 1 día
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
ilan-pinto/roaring-lions#1552 ·
Los mantenedores suelen responder en 1 día