DEMO SITE v1.7.20

Ajax action Bootstrap 4.5 theme

You can extend your buttons and links to be usable with xcrud's ajax interface. Your buttons can call functins, defined in your externall file. You must create action callback and add attributes to target element (button or something else)

    $xcrud = Xcrud::get_instance();
    $xcrud->create_action('publish', 'publish_action'); // action callback, function publish_action() in functions.php
    $xcrud->create_action('unpublish', 'unpublish_action');
    $xcrud->button('#', 'unpublished', 'icon-close glyphicon glyphicon-remove', 'xcrud-action', 
        array(  // set action vars to the button
            'data-task' => 'action',
            'data-action' => 'publish',
            'data-primary' => '{id}'), 
        array(  // set condition ( when button must be shown)
    $xcrud->button('#', 'published', 'icon-checkmark glyphicon glyphicon-ok', 'xcrud-action', array(
        'data-task' => 'action',
        'data-action' => 'unpublish',
        'data-primary' => '{id}'), array(
    echo $xcrud->render();

Base Fields