Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:30
    Kiran-Pawar edited #475
  • 08:29
    Kiran-Pawar edited #475
  • 08:29
    Kiran-Pawar opened #475
  • Feb 24 17:36
    kelvinsleonardo edited #474
  • Feb 24 16:20
    kelvinsleonardo opened #474
  • Feb 19 06:43
    lkachun9129 opened #473
  • Feb 17 17:15
    ajayojha commented #471
  • Feb 17 17:13
    kelvinsleonardo commented #471
  • Feb 12 11:01
    DuncanFaulkner opened #472
  • Feb 10 22:23
    kelvinsleonardo edited #471
  • Feb 10 22:21
    kelvinsleonardo opened #471
  • Feb 08 19:41
    zavadmar commented #460
  • Feb 08 10:22
    DuncanFaulkner commented #465
  • Feb 07 16:28
    mligtenberg commented #470
  • Feb 07 16:27
    mligtenberg opened #470
  • Feb 05 09:24
    afzalmansuri opened #469
  • Feb 04 09:44
    Ushmidave opened #468
  • Feb 04 08:24
    ajayojha closed #460
  • Feb 04 08:24
    ajayojha commented #460
  • Feb 02 11:52
    DuncanFaulkner closed #467
freshdev1
@freshdev1

@ajayojha This do not work:

export class TenantContractGeneralInformation {

    @disable({conditionalExpression:function(control:AbstractControl){return true; }})
    @prop()
    ContractNumber: string = '';

    @disable({conditionalExpression:function(control:AbstractControl){return true; }})
    @prop()
    ExternalContractNumber: string = '';

    AccountGUID: string = '';

    @required({ message: "FIELD_REQUIRED" })
    WorkerCity: string = '';

Any intended reason behind this? How do we mark fields as disabled if we want to without a second property.

freshdev1
@freshdev1

Guys this is my model

 @required({ message: "FIELD_REQUIRED" })
    @date({ message: "INVALID_DATE", allowISODate: true })
    @minDate({ value: new Date().toDateString(), message: "INVALID_DATE", allowISODate: true, fieldName:'ContractStartDate', operator: ">"  })
    ContractExpiryDate: Date;

and template:

<div class="col-4">
        <div class="form-group">
          <label for="ContractStartDate"
            class="control-label">{{ "TENANT_CONTRACT.GENERAL_INFORMATION.CONTRACT_START_DATE" | translate }}</label>
          <div class="form-group mycustom">
            <input type="text" autocomplete="none" class="form-control" placeholder='{{"SELECT_DATE" | translate}}'
              name="ContractStartDate" ngbDatepicker #dpContractStartDate="ngbDatepicker"
              formControlName="ContractStartDate" 

              />
            <div class="input-group-prepend">
              <button class="btn" (click)="dpContractStartDate.toggle()" type="button">
                <i class="far fa-calendar-alt"></i>
              </button>
            </div>
          </div>
          <small class="text-danger" *ngIf="generalInformationGroup.controls.ContractStartDate.errors">
            {{ generalInformationGroup.controls.ContractStartDate.errorMessage || 
              generalInformationGroup.controls.ContractStartDate.errors.date.message || 
              generalInformationGroup.controls.ContractStartDate.errors.mindate.message | translate }}</small>
        </div>
      </div>

I keep getting the invalid date error. can't apply min date validation

freshdev1
@freshdev1
@ajayojha dude can you tell me what mistake I am doing above.
MINDATE error is not removing
Nikunj V Kalathiya
@kalathiyan
image.png
HI RxTeam,
in above image SelectedJournal is object, is there any any way to bind that object instead of journalId in rx-select ?
freshdev1
@freshdev1
Group anybody who has faced the min error I mentioned above.
Any help would be appreciated. I don't understand where I am wrong.
freshdev1
@freshdev1
Anybody happen to use it with Template driven form?
I am finding it extremely hard to get it to work
it gives the following error:
Can't bind to 'rxwebform' since it isn't a known property of 'form'
Can anyone suggest what error I am making.
freshdev1
@freshdev1
fixed it. F has to be capital...
freshdev1
@freshdev1
now added a numeric validation. but it is not working
:(
freshdev1
@freshdev1
I think I will have to dump this product..... There is no support from the community around it.
I have been struggling so much but haven't got any response on anything to this date
Ushmidave
@Ushmidave
@freshdev1 template driven validation is applied along with the prefix rx, incase of numeric validation using [rxnumeric], Please refer to this example
freshdev1
@freshdev1
@Ushmidave thank you sir. But I do not see this in the documentation. I tried everything to get it to work.
but it works now in your example thank you. I will incorporate and comeback in case still it is not working.
Ushmidave
@Ushmidave
@freshdev1 the documentation of template driven numeric validation is present here
freshdev1
@freshdev1
Thank you for the guidance.
elharmouchi
@elharmouchi
2021-01-20_20-25-16.png
hello , please how to validate that user must check at less one checkbox using decorator based validation approach with rxweb
thank you
2021-01-20_20-38-20.png
Ushmidave
@Ushmidave
@elharmouchi i suggest you to use oneOf validation decorator for the described case : https://docs.rxweb.io/form-validations/oneOf/decorators
elharmouchi
@elharmouchi
@Ushmidave thank you pro
Nikunj V Kalathiya
@kalathiyan
Hi RxTeam
in rx-select do we have any provision to disable option from dropdown ?
image.png
like this ?
New York is disabled
freshdev1
@freshdev1
var docsControls = this.contractForm.controls["TenantContractDocuments"] as FormArray;
    docsControls.clear();
    docsControls = new FormArray([]);

    this.contractForm.controls["TenantContractDocuments"] = <RxFormArray> docsControls;

    documentsArray.forEach((element: DocumentModel) => {
      let docGroup = this.formBuilder.formGroup(DocumentSubmission);

      let document = element as DocumentSubmission;

      docGroup.patchValue(document);
      docsControls.push(docGroup);
    });
I don't know why when I try to get the this.contractForm.modelInstance under TenantContractDocuments I find there is an array but without any values
Ushmidave
@Ushmidave
@freshdev1 The purpose of modelInstance property to access the value of model object it will bind the value if there exist a value assigned to the particular property, for more clearity have a look at this stackblitz
freshdev1
@freshdev1
i can see value in model Object but it does not translate to modelInstance
@Ushmidave my scenario is that I want to empty all the controls or objects from the FormArray, create a new one and then when I am submitting just call this modelInstance and paste the model to my API
what's happening is that the element gets added to docsControls but the values do not reflect, despite I already updating it through patchValue
Ushmidave
@Ushmidave
@freshdev1 it would be great if you could provide me a stackblitz link of your scenario
freshdev1
@freshdev1
Ok I will try to create one.
Ushmidave
@Ushmidave
@freshdev1 👍
freshdev1
@freshdev1
@Ushmidave I updated your example. And you can see nothing is happening.
where as the array should get updated and my new object should take its place
elharmouchi
@elharmouchi
2021-01-25_17-13-43.png
hello please how to deal with radiobutton in rxweb validation decorator thank you
freshdev1
@freshdev1
@elharmouchi what kind of validation you are looking for?
there is conditional expression that you can work with. which will respond based on the values of the other properties
elharmouchi
@elharmouchi
ok i tried to disabled some controls based to this radiobutton but i miss some thing
i use decorator disable in model class but dont work