jQuery UI Widgets Forums Navigation Tree JqxTree with CheckBox default value

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 7 years, 12 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • JqxTree with CheckBox default value #91373

    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]);
    }
    });

    JqxTree with CheckBox default value #91560

    Hristo
    Participant

    Hello mohammadTaghy,

    The checkItem method is using to check/uncheck (true/false) an item – $("#jqxTree").jqxTree('checkItem', $("#home")[0], true);.
    I hope this will help.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.