Как добавить фильтры данных таблицы в личном кабинете
Как реализовать
Указываем у колонок параметр "В фильтре"

Обрабатываем в GetItems. Извлекаем из @filters по коду и применяем фильтры для извлечения нужных записей.
CREATE PROCEDURE [dbo].[crud_watch_filters_getItems]
@filters CRUDFilterParameter READONLY,
@sort sql_variant,
@direction nvarchar(8),
@page int,
@pageSize int,
@username nvarchar(32)
AS
BEGIN
declare @ids TABLE (id int)
-- filters...
declare @filterCustomer nvarchar(128), @filterStatus nvarchar(64), @filterCreated nvarchar(64),
@filterPrice nvarchar(64), @filterisVisible bit, @filterCreated1 nvarchar(128), @filterStatus1 int
select @filterCustomer = Value from @filters where [Key] = 'customer'
select @filterStatus = Value from @filters where [Key] = 'status'
select @filterCreated = Value from @filters where [Key] = 'created'
select @filterPrice = Value from @filters where [Key] = 'price'
select @filterisVisible = try_cast(Value as bit) from @filters where [Key] = 'isVisible'
select @filterCreated1 = Value from @filters where [Key] = 'created1'
select @filterStatus1 = try_cast(Value as int) from @filters where [Key] = 'status1'
declare @dateStart date, @dateEnd date
set @dateStart = try_convert(date, dbo.str_splitPart(@filterCreated,' - ',1), 104)
set @dateEnd = try_convert(date, dbo.str_splitPart(@filterCreated,' - ',2), 104)
declare @priceBegin int, @priceEnd int
select @priceBegin = (select top 1 value from dbo.split(@filterPrice, ','))
select @priceEnd = (select top 1 value from dbo.split(@filterPrice, ',')
order by value desc)
insert into @ids
select o.id
from tst_orders o
join tst_products p on p.id = o.productID
join tst_customers c on c.id = o.customerID
where (isnull(@filterCustomer, '') = '' or c.name like '%'+@filterCustomer+'%' or c.fio like '%'+@filterCustomer+'%')
and (isnull(@filterStatus, '') = '' or statusID in (select try_cast(Value as int) from dbo.split(@filterStatus, ',')))
and (isnull(@filterCreated,'') = '' or convert(date, o.created, 104) between @dateStart and @dateEnd)
and (isnull(@filterCreated1, '') = '') or convert(date, o.created, 104) = convert(date, @filterCreated1, 104)
and (isnull(@filterisVisible,0) = 0 or isVisible = 1)
and (isnull(@filterStatus1,0) = 0 or statusID = @filterStatus1)
--- and (isnull(@filterPrice, '') = '' or o.price between @priceBegin and @priceEnd)
-- SELECT 1
Select
o.id id,
c.name customer,
c.fio desc_customer,
p.name,
(select name from tst_statuses where id = o.statusID) status,
isnull(format(o.created, 'dd.MM.yyyy'), '01.01.1900') created,
isnull(o.price, 0)price,
isnull(isVisible, 0)isVisible
from tst_orders o
join tst_products p on p.id = o.productID
join tst_customers c on c.id = o.customerID
where o.id in (select id from @ids)
order by
case when @sort = 'p.name' and @direction = 'down' then c.name end desc,
case when @sort = 'p.name' and @direction = 'up' then c.name end asc,
case when @sort = 'created' and @direction = 'down' then o.created end desc,
case when @sort = 'created' and @direction = 'up' then o.created end asc,
case when @sort = 'price' and @direction = 'down' then o.price end desc,
case when @sort = 'price' and @direction = 'up' then o.price end asc
OFFSET @PageSize * (@Page - 1) ROWS
FETCH NEXT @PageSize ROWS ONLY;
-- SELECT 2
select count(*) from @ids
--select 3
-- 4 SELECT Footer data or kanban/gantt data
END
Другие демостенды
— Как сделать зависимые фильтры в таблице на сайте— Как создать фильтр таблицы в виде дерева галочек на сайте
— Как создать предустановленные фильтры для таблицы на сайте (predefined filters)
— Сохранение фильтров таблицы - запоминание прежнего выбора фильтров
— Фильтр выбор с поиском по базе в таблице (select-search)
Что есть в базе знаний по этой теме
— Страницы. Как сделать редирект на другую страницу при загрузке— Как создать предустановленные фильтры для таблицы
— Интеграция API IpGeoBase Город по IP-адресу
— Интерактивное дерево для отображения иерархических структур
— Элементы стилизации в разметке страниц кабинетов на Falcon Space
— Режим быстрой фильтрации строк без обращения на сервер
— Фильтрация данных в таблице
Последние обновления
Интеграции 24.11.2025
Разное 24.11.2025
Форма 15.11.2025
Визуализация 02.11.2025
Таблица 08.10.2025
Форма 26.09.2025
Таблица 23.09.2025
Разное 23.08.2025
Таблица 21.08.2025
Форма 20.08.2025
Таблица 18.08.2025
Таблица 21.06.2025
Форма 07.06.2025
Форма 29.03.2025
Форма 17.02.2025
Файлы и документы 10.01.2025
Форма 01.11.2024
Форма 23.10.2024
SQL-инструмент для создания личных кабинетов на сайте
Платформа Falcon Space
Это снижение стоимости владения
за счет меньшего количества людей для поддержки
Это быстрое внесение изменений
по ходу эксплуатации программы
Это современный интерфейс
полная адаптация под мобильные устройства