Make all fields read-only in custom widget

Hafsa1
Mega Sage

I have created a custom widget with some fields, and this widget have fields which are filled. I want to make all fields as read-only. Only cancel button is available which will cancel the record in backend if clicked.

How can I make all fields read-only

4 REPLIES 4

Harshal Aditya
Mega Sage
Mega Sage

Hi @Hafsa1 ,

 

Hope you are doing well.

 

You can use ng-readonly angular directive. Just set its value to true in server side script

 

eg-

<input type = "text" ng-readonly = "data.setreadOnly" >

 

Server Side -

 

data.setreadOnly = true;

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

 

Hafsa1
Mega Sage

it's not working, updated service script too

<input class="form-control" type="text" maxlength="100" ng-readonly = "data.setreadOnly" ng-model="data.new_job_title"/>

Hi @Hafsa1 ,

 

 

I have tried below code in my PDI and it seems working

 

HarshalAditya_0-1690805397464.png

 

Could you please share your server side script ?

 

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

 

Hafsa1
Mega Sage

there are many custom fields 50+, is there any shorcuts?