ArtiGrid
Intro Tour
This demo shows how to implement an interactive tour guide using ArtiGrid's built-in tour functionality. The tour highlights key UI elements such as the add button, search bar, column filters, pagination, and bulk actions. The welcome message appears at the bottom of the screen for better visibility. Click the "Guide" button to start the tour.
<?php
$grid = new ArtiGrid();
// Tour configuration with welcome message positioned at the bottom
$grid->tour([
['intro' => 'Welcome to the payments panel.', 'position' => 'bottom'],
['element' => '.artigrid-add-btn', 'intro' => 'Create a new payment.', 'position' => 'bottom'],
['element' => '.artigrid-search', 'intro' => 'Search for payments.', 'position' => 'bottom'],
['element' => '.artigrid-search-col', 'intro' => 'Search by specific columns.', 'position' => 'bottom'],
['element' => '.artigrid-select-all', 'intro' => 'Select all checkboxes.', 'position' => 'bottom'],
['element' => '.artigrid-th-filter', 'intro' => 'Filter by columns.', 'position' => 'bottom'],
['element' => '.artigrid-perpage', 'intro' => 'Records per page.', 'position' => 'bottom'],
['element' => '.artigrid-buttons-actions', 'intro' => 'Actions: view, edit, delete, etc.', 'position' => 'bottom'],
['element' => '.artigrid-pagination', 'intro' => 'Pagination controls.', 'position' => 'bottom']
]);
$grid->tourOptions([
'nextLabel' => 'Next',
'prevLabel' => 'Previous',
'doneLabel' => 'Finish',
'showStepNumbers' => true,
'exitOnOverlayClick' => false,
'disableInteraction' => true
]);
$grid->tourButton([
'label' => 'Guide',
'icon' => 'fa fa-circle-question',
'class' => 'btn btn-outline-info btn-sm'
]);
// Custom CRUD template with < and > for display
$customTemplate = '
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-0">Payment Management</h5>
<div class="d-flex gap-2">
{tour_button}
{add_button}
{refresh}
</div>
</div>
<div class="mt-2 d-flex gap-2">
{bulk_delete}
{bulk_edit}
{search_input}
{search_column}
{export}
</div>
</div>
<div class="card-body p-0">
{table}
</div>
<div class="card-footer">
<div class="d-flex justify-content-between">
{perpage}
{pagination}
</div>
</div>
</div>';
$grid->setCrudTemplate($customTemplate);
$grid->table('payments')
->template('bootstrap5')
->crudCol(['customerNumber', 'checkNumber', 'paymentDate', 'amount'])
->modal();
echo $grid->render();
?>