jQuery UI Widgets Forums Form Disable input in jqxform

This topic contains 5 replies, has 3 voices, and was last updated by  JSt 5 months, 3 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Disable input in jqxform #103954

    mathod
    Participant

    Hello,
    How can i disable input text in a form please ?

    https://stackblitz.com/github/jqwidgets/angular_demos/tree/master/form/overview/

    On this example, i don’t know how I can disable input of FirstName.

    Thanks a lot

    Disable input in jqxform #103962

    Martin
    Participant

    Hello mathod,

    After the Form is created, you can get any of its fields using the getComponentByName method and customize it.
    I have updated the Example.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

    Disable input in jqxform #103974

    mathod
    Participant

    Thank you ! It works fine !

    But, if i don’t know which component is, for example for a dropDownList i will use :

          input.jqxDropDownList({disabled: true});
    

    but how can i know which component is. is it possible to know that with getComponentByName() ?
    because I’m looping on all inputs, and sometimes, it can be an other component than input. DropDownList for example of checkbox

    Thanks a lot

    EDIT:
    I have this bug, and i don’t know why :

    bugImage

    • This reply was modified 11 months, 1 week ago by  mathod.
    • This reply was modified 11 months, 1 week ago by  mathod.
    Disable input in jqxform #103980

    mathod
    Participant

    For my edit, it’s because my imput is a numberand not a text.
    I need to replace by inputValue.jqxNumberInput({disabled: true});

    But like i ask, how can i know which component is ? to call dynamically inputValue.jqxNumberInput or inputValue.jqxImput, inputValue.jqxDropDownList

    • This reply was modified 11 months, 1 week ago by  mathod.
    Disable input in jqxform #104021

    Martin
    Participant

    Hello mathod,

    You can check what is the class of the selected component.
    Please, look at the following Example.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

    Disable input in jqxform #106268

    JSt
    Participant

    Hi,
    I tried the same=> disable an input but during runtime.
    I change in the html the autoopen to false

    
    <jqxWindow #tenantsDialogRef [autoOpen]=false [theme]="'material'" [resizable]="false" [width]="450" [height]="550">
    	<div #windowHeader>Add new tenant</div>
    	<div style="overflow: hidden;" #windowContent>
    		<jqxForm #fillTenantDataForm 
    			[width]='450' 
    			[height]="'auto'" 
    			[template]='template'>
    		</jqxForm>
    	</div>
    
    </jqxWindow>
    

    and I open this window after a button press

    
    private addNewTenant() {
    
    	console.log(<code>TenantsComponent.addNewTenant(..) called</code>);
    
    	let input = this.fillTenantDataForm.getComponentByName('firstname');
    	input.jqxInput({ disabled: true });
    
    	this.tenantsDialogRef.open()
    }
    

    If I use the code above, the field is still enbled.

    If I change autoopen=true and the change the disable parameter in ngAfterViewInit(..) the field is disabled.
    Any hint for me?

    Regards
    J├╝rgen

    • This reply was modified 5 months, 3 weeks ago by  JSt.
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.