Freshsales Logo freshchat

Start a new topic
Solved

How do I access features ($db, $request, $container) within the callback?

You should assign “this” context to a variable, and use the variable within the callback function as shown in the below example:


 var that = this;

 this.$db.get("ticket:101")

.done(function(data)

 {

  jQuery(that.$container).find('#id').text('Success');

 })

 .fail(function(error_data)

 {

  console.log(error_data)

 });

Login or Signup to post a comment