Example #1
0
  json: function(value) {
    if (!value || typeof value === 'string') {
      return value
    }

    try {
      return JSON.stringify(value, null, 4).replace(/\n/g, '\r')
    } catch(e) {
      debug.log(e)
    }

    return value
  },
Example #2
0
  initialize: function(config) {
    List.superclass.initialize.call(this, config)

    var proxy = this.get('proxy')

    if (!proxy) {
      debug.log(__('请设置数据源(proxy)'))
    } else {
      if (proxy.LIST) {
        this.LIST = proxy.LIST.bind(proxy)
      } else if (!proxy.LIST) {
        this.LIST = function() {
          debug.log(__('数据源(proxy)缺少`LIST`方法'))
          return Promise.resolve({})
        }
      }
    }

    this.set('params', $.extend(this._getParams(0), this.get('params')))

    // 取列表
    this.getList()
  },
Example #3
0
 this.LIST = function() {
   debug.log(__('数据源(proxy)缺少`LIST`方法'))
   return Promise.resolve({})
 }
Example #4
0
 it('log', function() {
   debug.log('www')
 })