Change editor on click of cell

Hi,

I have a requirement, where I have two columns A and B. B is dependant on A.
Whenever I change the value in A column, I need to clear the corresponding B column's cell and need to change the editor type of B column dynamically.

As of now, when I change the value in A column, I am able to clear the value of B column and I am setting B column's editor - column.editor = 'some_editor'. Even this works fine as long as I am not using popup editors ie., combo/date

I am facing an issue, where if I select an option in A column for which, I need date editor in column B. First time, whenever I open any popup editor it works fine. Again, if I change any value in column A, for which I need a combo editor in B column, this time date editor popup is shown with an error.

I hope once popup editor is set to the column, it takes the same reference every time without allowing to change to other popup editor type.

Please suggest me on how to proceed.

Regards,
Nandeesh N

Comments

  • edited April 9

    In such use-case, the initialized popup has to be reset before opening the new editor.

    let config = grid.getColumnConfig(column_id);
    webix.delay(()=>{
        delete config.$popup;
        config.editor = newValue; 
    })
    

    Delay is required in case user may switch the editor at the very moment when the previous editor is closed, such as: https://snippet.webix.com/lw3uwso8

  • Hi Listopad,

    The version of Webix I am using is 5.1
    In this version, columnConfig.$popup is undefined.

    https://snippet.webix.com/capt2kwg

    Anyways, I have the reference to popup config. But if I delete that one, next time while opening editor, it throws an error while getting the reference for inputNode in getValue function of the editor.

  • edited April 13

    Any update on this?

  • @Nandeesh my apologies for the inconvenience,

    This feature was added in the late updates of 5.2, so I would recommend updating to the latest Webix version if you are using Pro version.

    All minor updates and fixes will be available in GPL version starting from the upcoming Webix 5.3 (scheduled to the end of this month).

  • Hi Listopad,

    Thanks for your suggestion.

    Isn't it possible to fix that issue in 5.1 version? because we have a major product release and not in a position to update to 5.2 at this moment.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!