Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
Conditional cell editing
posted
Hi,
In my project I need a column to contain combo-boxes for the user to select a predefined value.
I'm doing this using following configuration:

{key: "Duplicate", headerText: "Duplicate", width: "100px", dataType: "bool"},
...
features: [
{
name: 'Updating',
enableAddRow: false,
enableDeleteRow: false,
editMode: "cell",
columnSettings: [{
columnKey: "Duplicate",
editorType: 'combo',
required: true,
editorOptions: {
mode: "dropdown",
dataSource: [
{ID: true, Name: "Yes"},
{ID: false, Name: "No"}
],
textKey: "Name",
valueKey: "ID"
}
}
]
}]

This works as it should, but now I also need to be able to not show the combobox for certain rows (based on the value of another field in the row).
What would be the best approach to do that?
I was thinking to add following cell template
template: "{{if ${OtherField} == 0 }}" +
"<div></div>" +
"{{else}}" +
"${Duplicate}" +
"{{/if}}"
But this only makes sure the value is not shown initially, when clicking the cell it will still show the combobox.
What can I do to also hide the combobox?

Thanks for your answer!
  • 18204
    Verified Answer
    Offline posted

    Hi Marteen Thoelen,

    Thank you for posting in our forums!

    For clarification, do you specifically need your users to not be able to edit this specific cell at all, or that you want them to edit the cell, but not use a Combo editor?

    If you want to prevent the user from editing the cell, you can use the editCellStarting event as described in this forum thread.

    If you need further assistance with this, please let me know.