modx.grid.tv.security.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Loads a grid of resource groups assigned to a resource.
  3. *
  4. * @class MODx.grid.TVSecurity
  5. * @extends MODx.grid.Grid
  6. * @param {Object} config An object of options.
  7. * @xtype modx-grid-tv-security
  8. */
  9. MODx.grid.TVSecurity = function(config) {
  10. config = config || {};
  11. var tt = new Ext.ux.grid.CheckColumn({
  12. header: _('access')
  13. ,dataIndex: 'access'
  14. ,width: 40
  15. ,sortable: false
  16. });
  17. Ext.applyIf(config,{
  18. id: 'modx-grid-tv-security'
  19. ,url: MODx.config.connector_url
  20. ,fields: ['id','name','access','menu']
  21. ,baseParams: {
  22. action: 'element/tv/resourcegroup/getList'
  23. ,tv: config.tv
  24. }
  25. ,saveParams: {
  26. tv: config.tv
  27. }
  28. ,width: 800
  29. ,paging: true
  30. ,remoteSort: true
  31. ,plugins: tt
  32. ,columns: [{
  33. header: _('name')
  34. ,dataIndex: 'name'
  35. ,width: 200
  36. ,sortable: true
  37. },tt]
  38. });
  39. MODx.grid.TVSecurity.superclass.constructor.call(this,config);
  40. };
  41. Ext.extend(MODx.grid.TVSecurity,MODx.grid.Grid);
  42. Ext.reg('modx-grid-tv-security',MODx.grid.TVSecurity);