title: JsTree Checkbox check Based on data-id
body: <p>I want to check unchecked checkbox in based on data-id.
  On drop down change i want to check unchecked checkbox in jstree.
  I am Providing MY controller and Ajax Method bellow.</p>
  
  <p>This is my jstree view.<a href="https://i.stack.imgur.com/YGX6S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YGX6S.png" alt="enter image description here"></a></p>
  
  <p>Here is My Controller :</p>
  
  <pre><code> [HttpPost]
      public ActionResult GetSingleUser(int id)
      {
          MachineShopDBEntities DB = new MachineShopDBEntities();
          var SPresult = DB.GetSingleUser(id).FirstOrDefault();
          return Json(SPresult);
      }
  </code></pre>
  
  <p>Here is my Script:</p>
  
  <pre><code>   $("#UserSelect").change(function () {
          $.post("/MenuMaster/GetSingleUser?id=" + $(this).val(),
                  function (data, status) {
                      var databaseString = data.MenuEnable;
                      for (i = 0; i &lt;= databaseString.length; i++) {
                          if (databaseString.substring(i, i + 1) == "1") {
                              $('.jstree-container-ul li[data-id=' + (i + 1) + ']').find('.jstree-anchor').addClass('jstree-clicked');
                          }
                      }    
                  });
      });
  </code></pre>