title: Enabling jQuery contextMenu item on ajax request
body: <p>I'm trying to update <a href="http://medialize.github.com/jQuery-contextMenu/docs.html" rel="nofollow noreferrer">contextmenu</a> item if ajax requests alters my div content. </p>
  
  <p>Here is what I mean I have a div like this :</p>
  
  <pre><code>&lt;div id="" class="message" data-options='{"update":"YES", "delete":"NO"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And context Menu jquery part (this happens only once when body loads):</p>
  
  <pre><code>$.contextMenu({
          selector: '.message', 
          trigger: 'left',
          callback: function(key, options) {
              var m = "clicked: " + key;
              window.console &amp;&amp; console.log(m) || alert(m); 
          },
          items: {
              "update": {
                  name: "Update",
                  disabled: function(key, opt) { 
                      return (this.data("options").update === "NO")
                  },
              },
              "delete": {
                  name: "Delete", 
                   disabled: function(key, opt) { 
                      return (this.data("options").delete=== "NO")
                  }
             //etc. rest of the code
  </code></pre>
  
  <p>I'm looking to re-create it when some ajax request happens or disable/enable items somehow</p>
  
  <p>So now some ajax requests happen and on success I'm trying to update <code>div.message</code> <code>data-option</code> because I though of enabling/disabling buttons like this :</p>
  
  <pre><code>In ajax.success function :
  - disable or enable menu items 
  </code></pre>
  
  <p><code>--------Actually--------Simplified</code></p>
  
  <p>Actually this question/answer is very similar to my current issue :</p>
  
  <p><a href="https://stackoverflow.com/questions/4728957/disable-and-enable-jquery-context-menu">Disable and enable jQuery context menu</a></p>
  
  <p>I want to enable/disable contextMenu item on some button click, if I were able to do in this dummy example I think I could handle ajax request as well.</p>