Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridField and FilterEditor

    I have a List Grid in which one field has validators. This List Grid also has a Filter Editor for this field. The problem is that the Filter Editor also has the same validators as the field itself.
    How do I make sure that validators are not applied to the Filter Editor?

    Code:
                  <ListGrid ID="customersList" dataSource="customersDS" width="100%" height="*" canEdit="false" autoFetchData="true" selectionType="single"
                    showFilterEditor="true" gridComponents={["header", "filterEditor", "body"]}
                    selectionChanged={this.onSelectCustomers} rowEditorExit={this.onEditCustomerExit}
                  >
                    <fields>
                      <LGField name={CONSTANT.NAME} validateOnChange="true">
                        <validators>
                          <Validator type="custom" condition={function (item, validator, value, record) { return (value && value !== ''); }} errorMessage={EvolutionServer.getString("emptyMandatoryField")} />
                          <Validator type="custom" condition={this.isNameFree.bind(this)} errorMessage={EvolutionServer.getString("nameBusy")} />
                          <Validator type="regexp" expression="^[a-zA-Z0-9_]+$" errorMessage={EvolutionServer.getString("forbiddenChars")} />
                        </validators>
                      </LGField>
                    </fields>
                  </ListGrid>
    Click image for larger version

Name:	Screenshot 2024-04-05 065817.png
Views:	49
Size:	27.0 KB
ID:	272087
    Version SNAPSHOT_v13.1d_2024-04-02/Pro Deployment (2024-04-02)


    #2
    This was not an issue specific to our React support, but a general one affecting any ListGrid configured with those settings.

    We've applied a fix so that custom validators like the ones you declared are not applied to the FilterEditor. The fix is in today's nightly build dated 2024-04-19.

    Comment

    Working...
    X