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
15
Igx hierarchical grid maxlenght
posted

Hi

So i´m trying out the hierarchical and wile in edit i would like to set a maxlenght for the input text. But it seems like it cant be done.

<igx-column field="textValue" header="text" [resizable]="true" [editable]="true"></igx-column>

Parents
  • 1560
    Offline posted

    Hello,

    I have been looking into your requirement and my suggestion is to retemplate the igxCellEditor by adding and input and set its maxLength property to the desired value.

    I created a small sample in order to demonstrate how such behavior could be achieved by setting the maXLength property of the "Country" column to 12:

    <igx-column field="Country" [resizable]="true" [editable]="true">
               <ng-template igxCellEditor let-cell="cell">          
                    <igx-input-group>
                        <input igxInput name="country" type="text" maxLength="12"
                        [(ngModel)]="cell.value"/>
                    </igx-input-group>             
               
            </ng-template>
            </igx-column>

    Here could be found my sample for your reference. Please test it on your side and let me know if I may be of any further assistance.

    Sincerely,

    Teodosia Hristodorova

    Associate Software Developer

Reply Children