gui.enableListSort

Enable/disable sorting on a list component.

Prototype

  1. bOk = gui.enableListSort ( hComponent, bEnable )

Description

Before doing time-consuming work on a list, it is recommended that you disable this feature before the operation and then turn it back on at the end.


Parameters

hComponent - valid GUI component handle
bEnable - true to enable, false to disable


Return values

bOk - true on success


Sample

  1. function buildMainViewFileListThumbnails ( _hList, kFileType )
  2.  
  3. local hList = _hList or gui.getComponent ( "MainView.list.thumbnails" )
  4. if ( hList ) then
  5.  
  6. -- disable
  7. gui.enableListFilter ( hList, false )
  8. gui.enableListSort ( hList, false )
  9. gui.setComponentUpdatesEnabled ( hList, false )
  10.  
  11. -- do stuff [...]
  12.  
  13. -- now re-enable
  14. gui.enableListFilter ( hList, true )
  15. gui.enableListSort ( hList, true )
  16. gui.setComponentUpdatesEnabled ( hList, true )
  17. end
  18. end

Available since ShiVa 2.0