본문 바로가기
Dev/ExtJS

EmptyText가 form과 함께 같이 저장될 때

by 코딩삐약 2022. 12. 22.

extjs에서는 textfield의 placeholder를 쓰려면 

emptyText를 쓰는데

 

textfield에 값이 없으면 그대로 emptyText로 지정한 값이 DB에 저장되어버리는 문제 발생

 

저장form을 submit해주는 곳에

submitEmptyText: false

 

속성을 추가해주면 된다.

 

관련 문서

https://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.action.Action-cfg-submitEmptyText

 

Ext JS - Sencha Docs

Welcome to Ext JS 4.2! Ext JS 4.2 is a pure JavaScript application framework that works on all modern browsers from IE6 to the latest version of Chrome. It enables you to create the best cross-platform applications using nothing but a browser, and has a ph

docs.sencha.com

 

cf) emptyText 문단 개행하고 싶으면 \n 사용