Guest User

Untitled

a guest
Oct 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.define 'SP.view.search.Search',
  2.   extend: 'Ext.grid.Panel'
  3.   requires: ['Ext.toolbar.Paging']
  4.   config:
  5.     columns: []
  6.   constructor: (config) ->
  7.     @callParent arguments
  8.   initComponent: () ->
  9.     @store = if typeof @store is "string" then Ext.create @store
  10.     if @searchTypes and @searchTypes.length > 0
  11.       @tbar = Ext.create 'SP.view.search.SearchToolbar'
  12.         searchTypes: @searchTypes
  13.         searchTip: @self.searchTip
  14.     pagingToolbar = Ext.create 'Ext.toolbar.Paging',
  15.       store: @store
  16.       dock: 'bottom'
  17.       displayInfo: true
  18.     @dockedItems = [pagingToolbar]
  19.     @callParent arguments
  20.   initStateEvents: () ->
  21.     events = this.stateEvents
  22.     #dont save sort order
  23.     Ext.each ['columnresize', 'columnmove', 'columnhide', 'columnshow'], () ->
  24.         if Ext.Array.indexOf(events, event)
  25.             events.push(event)
  26.   listeners:
  27.     searchRequested:
  28.       fn: (searchParams) ->
  29.         @store.currentPage = 1
  30.         @store.proxy.extraParams = searchParams
  31.         @store.load
  32.           scope: @
  33.           callback: () ->
  34.             shouldSort = @store.data.getCount() < @store.pageSize
  35.             @allowSortable = shouldSort
  36.             #for column in @columns
  37.             #  column.sortable = shouldSort
  38.             #@reconfigure null, @columns
  39.     render:
  40.       fn: () ->
  41.         if @ownerCt and @ownerCt.setTitle
  42.           @ownerCt.setTitle (@initialTitle or "")
  43.   width: '100%'
  44.   allowSortable: false
Add Comment
Please, Sign In to add comment