Ext.util.Format 클래스~




http://www.extjs.com/deploy/dev/docs/?class=Ext.util.Format



간만에 extjs 로 코딩할 거리가 생겼습니다. -_-;;;; 스크립트 손 놓은지 오래됐는데;;;


유용한 extjs util 클래스를 정리하고자 합니다.




























































































































함수명

파라미터

리턴값

설명



capitalize



String value



String


Converts the first character only of a string to upper case

첫번째 문자를 대문자로 바꾸는 함수로 추정됩니다.




date



String/Date value, [String format]



String

Parse a value into a formatted date using the specified format pattern.

형식에 맞게 날짜/시간을 변환합니다.



dateRenderer



String format



Function

Returns a date rendering function that can be reused to apply a date format multiple times efficiently

안써봐서 모르겠습니다. ㅋㅋㅋ



defaultValue



Mixed value, String defaultValue



String

Checks a reference and converts it to the default value if it's empty

값이 비어 있을 경우 기본값으로 반환해줍니다.



ellipsis



String value, Number length



String

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length

문자열의 길이가 일정 길이를 넘어서면 해당길이 뒤에 '…' 을 붙여 표시합니다.




fileSize




Number/String value



String

Simple format for a file size (xxx bytes, xxx KB, xxx MB)

파일크기로 변환해줍니다.




htmlDecode






String value



String

Convert certain characters (&, <, >, and ') from their HTML character equivalents.

인코딩된 특정 문자를 디코딩합니다.



htmlEndcode



String value



String

Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.

특정 문자를 인코딩합니다.



lowercase



String value



String

Converts a string to all lower case letters

문자열을 소문자로 변환합니다.



nl2br



String The



String

Converts newline characters to the HTML tag <br/>

뉴라인을 <br/> 태그로 변환합니다.



stripScripts



Mixed value



String

Strips all script tags

script 태그를 벗겨내는 건가요???



stripTags



Mixed value



String

Strips all HTML tags

HTML 태그들을 벗겨내는...???




substr




String value, Number start,



Number length



String

Returns a substring from within an original string

문자열을 잘라냅니다.



trim



String value



String

Trims any whitespace from either side of a string

좌우 공백을 제거합니다.



undef



Mixed value



Mixed

Checks a reference and converts it to empty string if it is undefined

파라미터가 undefined 일 경우 빈 스트링을 반환???



uppercase



String value



String

Converts a string to all upper case letters

대문자로 변환합니다.




usMoney




Number/String value





String

Format a number as US currency

미국 통화단위로 포맷팅합니다.


스크립트는... 정말~ 피곤하지만 재밌는 언어입니다. ㅋㅋㅋㅋ



댓글

가장 많이 본 글