mark multiple checkboxes as checked
mark multiple checkboxes as checked
maruf22
Posts: 1Questions: 1Answers: 0
i am facing problems on setting checkbox as checked. label and values are coming from json data.i can show them on my edit form.but can't mark them as checked once they met certain criteria.here's what i have done so far.
editor.on('initEdit', function (e, node, data) {
var apartment_complexes_id = editor.field('apartments.apartment_complexes_id').val();
$.ajax({
type: "GET",
url: "getAllGates/" + apartment_complexes_id,
dataType: "json",
success: function (JSONObject) {
var options = [];
// Loop through Object and create peopleHTML
for (var key in JSONObject) {
if (JSONObject.hasOwnProperty(key)) {
console.log(JSONObject[key]["name"]);
options.push({label: JSONObject[key]["name"], value: JSONObject[key]["id"], input: "checked"});
}
}
editor.field('gates[].id').update(options);
}
});
});
This discussion has been closed.