Guest User

Untitled

a guest
Jul 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. /**
  2. * Panel avec un toolbar pour choisir la sorte de shit qu'on veut.
  3. */
  4. CCA.intermission.Browse = Ext.extend(Ext.Panel, {
  5. sortBy: null,
  6. category: null,
  7. autoHeight: true,
  8. frame: false,
  9. border: false,
  10.  
  11. initComponent: function() {
  12. this.items = [
  13. new CCA.intermission.Toolbar,
  14. new CCA.intermission.DataView({
  15.  
  16. })
  17. ];
  18. this.on("categoryclicked", function() {
  19. alert("meh");
  20. }, this);
  21. CCA.intermission.Browse.superclass.initComponent.call(this);
  22. }
  23. });
  24.  
  25.  
  26. /**
  27. * A toolbar with buttons to choose a category and a drop down to decide on the sorting.
  28. */
  29. CCA.intermission.Toolbar = Ext.extend(Ext.Panel, {
  30. autoHeight: true,
  31. html: '<span>Number of results...</span><select name="meh"><option>date</option><option>title</option></select>',
  32.  
  33. initComponent: function() {
  34. this.tbar = [
  35. {text: "all", handler: this.buttonClick.createDelegate(this, ['all'], true)},
  36. {text: "NASA", handler: this.buttonClick.createDelegate(this, [1], true)},
  37. {text: "SNASM", handler: this.buttonClick.createDelegate(this, [2], true)},
  38. {text: "NFB", handler: this.buttonClick.createDelegate(this, [3], true)},
  39. {text: "UbuWeb", handler: this.buttonClick.createDelegate(this, [4], true)},
  40. {text: "Thursday Night Features", handler: this.buttonClick.createDelegate(this, [5], true)}
  41. ];
  42. this.addEvents("categoryclicked");
  43. CCA.intermission.Toolbar.superclass.initComponent.call(this);
  44. },
  45.  
  46. buttonClick: function(button, e, category) {
  47. this.fireEvent("categoryclicked", category);
  48. alert("just fired an event!");
  49. }
  50. });
Add Comment
Please, Sign In to add comment