Premium support for our pure JavaScript UI components


Post by rushikesh »

[CODE]

  1. ENVIRONMENT
    ========================================

Component : Bryntum Gantt
Editor Type : Combo (AjaxStore, URL-based)
Framework : React + TypeScript
Package : @bryntum/core-thin
Column Type : Custom Field (non-Bryntum column, bryntum: false)

========================================

  1. PROBLEM SUMMARY
    ========================================

We have implemented a custom "User" type combo column in the Bryntum Gantt grid.

Issue:

  • Clicking the cell does NOT open the dropdown

Even though:
✔ Column has readOnly: false
✔ Editor configuration is defined
✔ API URL is correct and returns valid data

Attachment:

========================================

  1. COLUMN CONFIGURATION (SERVER RESPONSE)
    ========================================
{
    "sortable": true,
    "resizable": true,
    "title": "User CF",
    "dataIndex": "t_cf_2521",
    "id": "t_cf_2521",
    "width": 134,
    "editPerms": [321],
    "pn": "custom_cf2521",

"editor": {
    "type": "combo",
    "options": [],
    "minChars": 2,
    "url": "comboquery.do?what=person&purpose=USER",
    "name": "custom_cf2521",
    "fieldLabel": "User CF",
    "multiple": false,
    "allowBlank": true,
    "allowClear": true
},

"field": "custom_cf2521",
"name": "custom_cf2521",
"renderer": "bizObjectRenderer",

"bryntum": false,
"readOnly": false,
"cWidth": true
}

========================================

  1. API RESPONSE (COMBO URL)
    ========================================

Endpoint:
comboquery.do?what=person&purpose=USER
Response:

[
    {
        "iconTitle": "User",
        "mentionName": "AaryanThipse",
        "depth": 0,
        "avatarUrl": "https://dev.celoxis.io/psa/ui/avatar.do?...",
        "name": "Aaryan Thipse",
        "client": false,
        "value": 3176,
        "iconCls": null,
        "label": "Aaryan Thipse",
        "holy": false,
        "tooltip": "Workspaces: Default",
        "fqName": "Aaryan Thipse"
    },
    {
        "iconTitle": "User",
        "mentionName": "AmishSharma",
        "value": 3175,
        "label": "Amish Sharma",
        "name": "Amish Sharma"
    }
]

========================================

  1. OBSERVED BEHAVIOR
    ========================================

  2. Clicking the cell does not able to edit.

  3. Dropdown is not opening at all

========================================

  1. EXPECTED BEHAVIOR
    ========================================

  2. Clicking the cell should open a combo dropdown

  3. Dropdown should fetch and display API data

  4. User should be able to select a value

========================================

  1. ADDITIONAL CONTEXT
    ========================================

  2. This is a custom column (bryntum: false)

  3. Editor is configured using a URL-based approach

  4. API response includes both "value" and "label" fields

  5. No explicit store configuration is provided for the combo

========================================

  1. QUESTIONS
    ========================================

  2. Is editing supported for columns marked as "bryntum: false"?

  3. Does the combo editor REQUIRE explicit store configuration
    instead of only providing a "url"?

  4. Are we missing required mappings such as:

    • valueField
    • displayField ?
  5. Could this issue be related to how editors are initialized
    for custom (non-Bryntum) columns?

========================================

  1. EXPECTED GUIDANCE
    ========================================

We are looking for:

  • Correct way to configure a dynamic combo editor
  • Best practice for integrating custom columns with editors
  • Any required changes for enabling editing in such cases

-Code Ref:

import { AjaxStore } from "@bryntum/core-thin";

import Utils from "src/Utils";

const bryntumEditorTypeMap = {
  text: (editor) => ({
    type: "text",
  }),
  date: (editor) => {
    const dateEditor: any = {};
    dateEditor.type = "datefield";
    dateEditor.weekStartDay = editor.startDay;
    dateEditor.format = editor.format;
    dateEditor.stepTriggers = false;
    dateEditor.keepTime = "entered";
    return dateEditor;
  },
  combo: (editor) => {
    const comboEditor: any = { ...editor };

if (!editor.url) {
  comboEditor.items = editor.options;
}

comboEditor.multiSelect = editor.multiple;
if (editor.url) {
  comboEditor.store = new AjaxStore({
    autoLoad: true,
    readUrl: Utils.getResourceUrl(editor.url),
    responseTotalProperty: "total",
    responseDataProperty: "root",
    pageSizeParamName: "limit",
    pageParamName: "page",
    filterParamName: "query",
    pageSize: 100,
    remotePaging: true,

    encodeFilterParams: (filters) => {
      let filterValue;
      filters.forEach((filter) => {
        filterValue = filter.value;
      });
      return filterValue;
    },
  } as any);
}

comboEditor.displayField = "label";
comboEditor.valueField = "value";
comboEditor.minChars = editor.minChars;
comboEditor.keyStrokeFilterDelay = 500;

// Adds a clear (✕) button to reset the selected value when allowClear is enabled
comboEditor.clearable = editor.allowClear;

return comboEditor;
  },
  number: (editor) => ({
    type: "number",
  }),
  richText: (editor) => ({
    type: "textArea",
  }),

  taskTeamPicker: () => {
    const resourceEditor: any = {};
    resourceEditor.picker = {};

return resourceEditor;
  },
  duration: () => {
    const durationEditor: any = {};

return durationEditor;
  },
};

export { bryntumEditorTypeMap };

========================================

[/CODE]


Post by alex.l »

Hi,

We need runnable test case to debug the problem. It's working in our demos, we need to check your solution. The configs you provided are not consistent, as far as I see you set type combo, which means use our Combo, but setup is not correct. What bryntum: false means for our Column class?
Please check our demo here https://bryntum.com/products/grid/examples/frameworks/react-vite/cell-edit/dist/ it shows how to use custom editors.

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy


Post Reply