 kd                   = require 'kd'
 KDView               = kd.View
+KDSelectBox          = kd.SelectBox
+KDCustomHTMLView     = kd.CustomHTMLView
+KDHitEnterInputView  = kd.HitEnterInputView
 whoami               = require 'app/util/whoami'
-KDSelectBox          = kd.SelectBox
 MemberItemView       = require './memberitemview'
-KDCustomHTMLView     = kd.CustomHTMLView
-KDListViewController = kd.ListViewController
-KDHitEnterInputView  = kd.HitEnterInputView
 remote               = require('app/remote').getInstance()
-
+KodingListController = require 'app/kodinglist/kodinglistcontroller'
 
 module.exports = class TeamMembersCommonView extends KDView
 

  refresh: ->

    @resetListItems()
    @fetchMembers()


  createListController: ->

    { noItemFoundText, listViewItemOptions, fetcherMethod, listViewItemClass } = @getOptions()
    group = @getData()

    @listController       = new KodingListController
      noItemFoundText     : noItemFoundText
      lazyLoadThreshold   : .99
      sort                : { timestamp: -1 }
      itemClass           : listViewItemClass or MemberItemView
      viewOptions         :
        wrapper           : yes
        itemOptions       : listViewItemOptions
      fetcherMethod       : (query, fetchOptions, callback) =>
        group[fetcherMethod] query, fetchOptions, (err, members) -> callback err, members

    @listController.addListItems = @bound 'listMembers'

    @addSubView @listController.getView()

