Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. changeGridValue: function(model) {
  2. var id = model.get('id');
  3. console.log(model.get('value'));
  4. console.log(model);
  5. this.container.find('table').jqGrid('setCell', 1, id, model.get('value') + " " + model.get('unit'));
  6.  
  7. this.reloadView();
  8. //this.jqgridElem.setCell();
  9.  
  10. define(["jquery" ,
  11. "underscore" ,
  12. "backbone" ,
  13. "viewA",
  14. "viewB",
  15. //the others file
  16. ],function($ , _ , Backbone, viewA, viewB){
  17.  
  18. var signInView = Backbone.View.extend({
  19. initialize: function() {
  20. // listen to viewA and viewB and fire signIn action in this view
  21. this.listenTo(this.viewA, "signIn", this.signIn);
  22. this.listenTo(this.viewB, "signIn", this.signIn);
  23. },
  24. events : {
  25. 'click #signInBtn' : 'signIn'
  26. },
  27. signIn : function(youCanPassYourFormModelHere){
  28. this.trigger("signIn");
  29. }
  30. });
  31. return viewB;
  32. });
  33.  
  34. define(["jquery" ,
  35. "underscore" ,
  36. "backbone" ,
  37. "text!templates/Layout/signIn.html"
  38. //the others file
  39. ],function($ , _ , Backbone, SignIn){
  40.  
  41. var viewA = Backbone.View.extend({
  42. initialize: function() {
  43.  
  44. },
  45. events : {
  46. 'click #signInBtn' : 'signIn'
  47. },
  48. signIn : function(){
  49. this.trigger("signIn", formModel);
  50. }
  51. });
  52. return viewA;
  53. });
  54.  
  55.  
  56. define(["jquery" ,
  57. "underscore" ,
  58. "backbone" ,
  59. "text!templates/Layout/signIn.html"
  60. //the others file
  61. ],function($ , _ , Backbone, SignIn){
  62.  
  63. var viewB = Backbone.View.extend({
  64. initialize: function() {
  65.  
  66. },
  67. events : {
  68. 'click #signInBtn' : 'signIn'
  69. },
  70. signIn : function(){
  71. this.trigger("signIn", formModel);
  72. }
  73. });
  74. return viewB;
  75. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement