Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

created subscribe method not being called in the controller.

$
0
0
Hi All,

I am trying to get my created subscribe called but it fails to do so. Below is my code. Any sort help would be highly appreciated. I have spent two days on this and now absolutely clueless. Thanks in advance

  1. steal('jquery/controller',
  2. 'jquery/dom/form_params',
  3. 'jquery/view/ejs',
  4. 'jquery/controller/view',
  5. 'jquery/controller/subscribe',
  6. 'steal/less')
  7. .then(function(){
  8. $.Controller('DefectController',{},
  9. // Some code ...

  10. "defect.created subscribe" : function(called, defect){
  11.      this.refreshResults();
  12.     },

  13. // Some code

  14. });


  15. $.Model.extend('Defect',
  16. /* @Static */
  17.       create : function(params, success, error){
  18.       
  19.             $.ajax({
  20.             url: 'defects.json',
  21.             type: 'post',
  22.             cache: false,
  23.             dataType: 'json defect.model',
  24.             success: success,
  25.             error: error,
  26.             complete: this.callback("createResponse",success, error),
  27.             data: $.toJSON(params),
  28.             fixture: "-restCreate"
  29.         })
  30.       
  31.       }
  32. }
  33. {

  34. created : function(attrs){
  35.         return this._super(attrs);
  36.     },

  37. }

  38. });


Viewing all articles
Browse latest Browse all 3491

Trending Articles