jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts

  • mohammadTaghy
    Participant

    Hi guys.I have a problem.I want to use of jqxtree with checkBox.I want to bind data with ajax,but in edit mode some checkbox have true value.
    I dont know how I can set value to checkbox.pleas help me.`
    $.ajax({
    url: url,
    data: “”,
    type: ‘POST’,
    contentType: “application/json; charset=utf-8”,
    dataType: “json”,
    success: function (json) {
    var result = $.parseJSON(json.d);
    var source =
    {
    datatype: “json”,
    localdata: result
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();
    var records = dataAdapter.getRecordsHierarchy(‘Id’, ‘ParentId’, ‘items’, [{ name: ‘Text’, map: ‘label’ }]);
    $(element).jqxTree({ source: records, hasThreeStates: true, checkboxes: true });
    $(element).on(‘change’, function (event) {
    var checked = event.args.checked;
    $(element).jqxTree({ hasThreeStates: checked });
    });
    $(element).jqxTree(‘selectItem’, $(“#home”)[0]);
    }
    });

Viewing 1 post (of 1 total)