Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • File

Index

Constructors

constructor

Methods

Static formatLength

  • formatLength(length: any): string
  • 格式化文件的大小长度

    example

    10KB 或 10M

    Parameters

    • length: any

    Returns string

Static isSuffixFile

  • isSuffixFile(fileName: string, ...suffix: any[]): boolean
  • 判断文件名是否以后缀名,包含了fastchar文件格式的判断

    Parameters

    • fileName: string

      文件名

    • Rest ...suffix: any[]

      后缀名,可传多个

    Returns boolean

Static officeViewer

  • officeViewer(url: string, newWindow?: any): void
  • 打开新窗口在线预览office办公文件

    Parameters

    • url: string

      文件地址

    • Optional newWindow: any

      是否在新的浏览器窗口打开

    Returns void

Static showFiles

  • showFiles(obj: any, callBack: any, fileModules: any, defaultFiles: any, title: any, readOnly?: any, showFileName?: any, showFileLength?: any): void
  • 弹出管理多个文件的窗口

    example

    showFiles(this,function(val){

    },[file.image(),file.excel()])

    Parameters

    • obj: any

      控件对象

    • callBack: any

      回调函数

    • fileModules: any

      文件类型

    • defaultFiles: any

      默认文件数据

    • title: any

      标题

    • Optional readOnly: any

      是否为只读模式

    • Optional showFileName: any

      显示附件名称

    • Optional showFileLength: any

      显示附件大小

    Returns void

Static uploadFile

  • uploadFile(obj: any, fileModules: any, multiple?: boolean, useEditUrl?: boolean): any
  • 弹出上传文件的对话框

    example

    uploadFile(this,[file.image(),file.excel()])

    Parameters

    • obj: any

      控件对象

    • fileModules: any

      文件类型

    • Optional multiple: boolean

      是否允许多选文件

    • Optional useEditUrl: boolean

      是否允许手动编写文件url

    Returns any

    Ext.Promise