JSON data looks like this:
{"id":8,"userName":"gentelman","fullname":"Alexen","email":"[email protected]",
"mobile":"0060111434325","designation":null,"add_content":1,"edit_content":1,
"delete_content":1,"manage_user":1,"view_log":1}
I am trying to make checkbox checked when add_content = 1, else make it unchecked. Now it works only when I refresh page. I want to make it work without refreshing page. How to do that?
load: function (id) {
var self = this;
KeyWord.byId(
id,
function (data) {
if (data.add_content == 1) {
$("#add_content").attr('checked', true);
} else {
$("#add_content").attr('checked', false);
}
self.formHandler.load(data);
},
function (error) { },
function () { }
);
}
add_content= 1make checkbox checked without refreshing page .now checkbox is working but after I refresh the pagepropin place ofattrhere?