title: ReferenceError: params is not defined
body: <p>I am trying to implement an inline bubble editing in my data table...</p>
  
  <p>I would like to implement it in many place. So I would like to create a global function. The following code is working fine:</p>
  
  <pre><code>"fnDrawCallback":function(){
      $('#data_table_list td').editable({
          params: function(params) {
              var pk = $(this).data('pk');
              var name = $(this).data('name');
              var data = {};
              data['field'] = name;
              data['value'] = params.value;
              data['id'] = pk;
              data['slug'] = slug;
              return data;
          },
          url: "{% url 'request_access' %}",
              success : function(data) {
              if (data.status == true) {
                  toastr.success(data.msg);
              }
              else {
                  toastr.error(data.msg);
              }
           },
           error: function () {
               toastr.error('Something went wrong');
           }
      });
  },
  </code></pre>
  
  <p>But I have tried the following code to implement as a global function.</p>
  
  <p>In my <code>core.js</code> file:</p>
  
  <pre><code>function python(params)
  {
      var pk = $(this).data('pk');
      var name = $(this).data('name');
      var data = {};
      data['field'] = name;
      data['value'] = params.value;
      data['id'] = pk;
      data['slug'] = slug;
      return data;
  }
  </code></pre>
  
  <p>And in my HTML page:</p>
  
  <pre><code>"fnDrawCallback":function(){
      $('#data_table_list td').editable({
          params: python(params),
          url: "{% url 'request_access' %}",
              success : function(data) {
              if (data.status == true) {
                  toastr.success(data.msg);
              }
              else {
                  toastr.error(data.msg);
              }
           },
           error: function () {
               toastr.error('Something went wrong');
           }
      });
  },
  </code></pre>
  
  <p>But it shows an error:</p>
  
  <blockquote>
    <p>ReferenceError: <code>params is not defined</code></p>
  </blockquote>
  
  <p>How can I create a global function?</p>