OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Datagrid inline edit date – allow empty

This topic contains 13 replies, has 3 voices, and was last updated by  Dawid 5 years, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #25558

    Dawid
    Participant

    Hey,
    any idea how to make possible to clear date from inline edit?
    My entity have date field, nullable=true.
    On datagrid when I edit and clear any existing date, cannot save empty value. With overrided validation rules, still nothing:

    date-editor-view.js looks ok, cannot localize problem, any help will be appreciate.

    Steps to reproduce:

    1. create grid with date field, and inline edit on,
    2. setup any date,
    3. try to set empty field – impossible

Viewing 13 replies - 1 through 13 (of 13 total)
  • Author
    Replies
  • #25559

    Andrey Yatsenko
    Moderator

    Hi,

    it’s not a valid configuration NotBlank: false
    Validation cannot be overridden in symfony, the only way to change it – changing validation groups.

    #25560

    Dawid
    Participant

    Its not a valid here, because doesn`t work :)
    But this is the right way to pass validator to inline edit js scripts right?
    Can you be more specific about validation groups?

    • This reply was modified 5 years, 11 months ago by  Dawid.
    #25562

    Andrey Yatsenko
    Moderator

    Is this your custom datagrid or you are trying to extend the built-in?

    #25563

    Dawid
    Participant

    It is my custom. Column is based on entity, that have field:

    Datagrid is simple, no validation asserts on entity.
    And column on datagrid is defined simple like that:

    Inline edit works fine, but cannot put empty value. Maybe date validator do it?

    #25564

    Andrey Yatsenko
    Moderator

    then just remove NotBlank: false from config, as it’s not needed.

    #25565

    Andrey Yatsenko
    Moderator

    And don’t worry about validation groups, I guess you want to override validation, but for new rules it’s not relevant.

    #25566

    Dawid
    Participant

    Yes I know, I just tryied to override not blank validator like that, based on default configuration specified inside date-editor-view.js:

    Its not working, so sure I will remove it. But why I cannot clear date value inside my field? When you setup any date, cannot be cleared.

    #25567

    Dawid
    Participant

    For a test I just created column in my datagrid:

    And with text editor its clear that required validator is on, there was a message. But why? Is default for date field?

    • This reply was modified 5 years, 11 months ago by  Dawid.
    #25569

    Dawid
    Participant

    Problem is also when I edit date on any form. Field is not required but empty value is not saved. Oro date field create fake date field and dont pass value if empty to original one

    #25570

    Andrey Yatsenko
    Moderator

    #25572

    Hryhorii Hrebiniuk
    Participant

    Hello @dawid.kamola,

    It looks like a bug of DateTimePickerView. What version of Oro do you use?
    In latest version DateTimeEditor works fine. Could you confirm that similar to your case works here https://demo.orocrm.com/desktop/task ?

    #25573

    Dawid
    Participant

    Hi, thank you for this answer! I have 2.5.0 and cannot set empty task date. But here I see it works, so it was fixed on 2.6? Or maybe on 3.0, I see is 3.0 beta there

    • This reply was modified 5 years, 11 months ago by  Dawid.
    #25575

    Dawid
    Participant

    Ok for anyone with same problem, I see it was fixed in 2.6:
    https://github.com/oroinc/platform/tree/2.6/src/Oro/Bundle/UIBundle/Resources/public/js/app/views/datepicker

    BAP-16591: Not able to clear the value in Date field (#16811)

    Thanks Hryhorii!

Viewing 13 replies - 1 through 13 (of 13 total)

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top