how to set custom buttons for each event based on a criteria

scheduler.attachEvent(“onEventLoading”, function(event){

           // alert(event.ConfirmedPhonebooking)
    //alert(event.section_id)
    //alert("event.PatientFirstName")
    if(event.ConfirmedPhonebooking == "checked"){
        return scheduler.config.icons_select = [
            "icon_details", //default button     
            "icon_delete", //Default button
            "icon_reserve_appoinment", //Custom button
        ];
       // scheduler.locale.labels.icon_cancel_reserve_appoinment = "Reserve";
    }else{
         return scheduler.config.icons_select = [
            "icon_details", //default button
            "icon_delete", //Default button
            "icon_cancel_reserve_appoinment", //Custom button
        ];
       // scheduler.locale.labels.icon_reserve_appoinment = "Cancel Reservation";                                           
    }
    return true;
});
scheduler.locale.labels.icon_cancel_reserve_appoinment = "Reserve";
scheduler.locale.labels.icon_reserve_appoinment = "Cancel Reservation";