1
내 비교기에 사용할 최소 문자열 값을 원합니다. 내 유효성 검사에서 name이 빈 문자열이되지 못한다고 가정합니다.백본 비교기에서 사용하기위한 최소 javascript 문자열 값
올바르게 작동하는 것 같습니다. 실패 할 "이름"의 값이 있습니까?
S.FileList = Backbone.Collection.extend
model: S.File
comparator: (file) ->
# We add display files alphabetically, but with meta.file at the top.
if file.get("name") == "meta.file"
return ""
return file.get("name")
이름이 비어 있다면 어떻게 될까요? – thejh
@thejh : "내 유효성 검사로 이름이 빈 문자열이되지 못한다고 가정하십시오." –
아, 죄송합니다. – thejh