Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources tab, custom input behaves old value as default value #6543

Closed
marciogurka opened this issue Apr 5, 2023 · 1 comment
Closed

Resources tab, custom input behaves old value as default value #6543

marciogurka opened this issue Apr 5, 2023 · 1 comment
Labels
bug Something isn't working forum Issues from forum

Comments

@marciogurka
Copy link

Forum post

Adding the following configuration to add a custom field, when changing the value, the value is not displayed correctly.

features : {
taskEdit: {
          items: {
            resourcesTab: {
              items: {
                grid: {
                  columns: {
                    data: {
                      titleLevel: {
                        text: "SEVİYE",
                        field: "titleLevelId",
                        renderer: (props) => {
                          // display the name in the cell
                          const value = props.column.editor.store.data.find(
                            (item) => item.id === props.value
                          );
                          return value?.name;
                        },
                        editor: {
                          type: "combo",
                          valueField: "id",
                          displayField: "name",
                          required: true,
                          store: {
                            idField: "id",
                            data: [{id:1, name:"test 1"}, {id:2, name:"test 2"}],
                          },
                        },
                      },
                    },
                  },
                },
              },
            },
          },
        },
},
@marciogurka marciogurka added bug Something isn't working forum Issues from forum labels Apr 5, 2023
@matsbryntse
Copy link
Member

Correct code should be:


renderer: (props) => {
                          // display the name in the cell
                          const value = props.column.editor.store.data.find(
                            (item) => item.id === props.value
                          );
                          return value?.name || '';
                        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum
Projects
None yet
Development

No branches or pull requests

2 participants