how can i checkbox to be checked based on the value in the database .if the status(is_closed) is 1 then the checkbox to be checked
echo $form->field($model, 'is_closed')->checkbox(['id'=>'checkbox-'.$value->action_status_id,'class'=>"input_class input_checkbox",'value'=>$value['is_closed'],
'onClick'=> new yii\web\JsExpression("
var tableUsed = 'status';
var obj=$(this);
var id = $(this).attr('id').split('-');
var dInput= $(this).val();
$.ajax({
type : 'POST',
data : {'id':id[1]},
url: '".Yii::$app->getUrlManager()->createUrl("actions/setting-checkbox-update")."',
success: function(data){
var tableRow = obj.closest('tr');
tableRow.find('.saving').show();
setTimeout(function(){ tableRow.find('.saving').hide();}, 500);
stat=JSON.parse(data)
tableRow.find('.input_checkbox').prop('checked', stat.closed== 1);
}
});
")])->label(FALSE);
$value['is_closed] have value 1 or 0 based on the database value