TemKa_SD Posted November 9, 2018 Share Posted November 9, 2018 Здравствуйте. Мне нужно реализовать фильтрацию по году и месяцу, Они расположены в отдельных столбцах как целые числа. У меня уже есть готовый модуль реализованный с помощью таблиц, возможно ли такое сделать? С чего начать? Link to comment Share on other sites More sharing options...
newbie Posted November 13, 2018 Share Posted November 13, 2018 $table->filters Link to comment Share on other sites More sharing options...
TemKa_SD Posted November 14, 2018 Author Share Posted November 14, 2018 Блин, не соображу что-то: http://prntscr.com/li46p2. Начинаем так, затем в шаблоне делаем нужный функционал? Link to comment Share on other sites More sharing options...
newbie Posted November 14, 2018 Share Posted November 14, 2018 Если делать через $table->filters, то список будет очень длинным.Лучше сделать форму с 2-мя (год и месяц) Link to comment Share on other sites More sharing options...
TemKa_SD Posted November 14, 2018 Author Share Posted November 14, 2018 (edited) А как мне переменные вывести вместе с $table? http://prntscr.com/li4yimТам просто вместе с $table цепляется еще несколько переменных автоматически. Edited November 14, 2018 by TemKa_SD Link to comment Share on other sites More sharing options...
newbie Posted November 14, 2018 Share Posted November 14, 2018 Там просто вместе с $table цепляется еще несколько переменных автоматически. Где? Link to comment Share on other sites More sharing options...
TemKa_SD Posted November 14, 2018 Author Share Posted November 14, 2018 /* Display */ \IPS\Output::i()->output = (string) $table; Link to comment Share on other sites More sharing options...
newbie Posted November 14, 2018 Share Posted November 14, 2018 Где тут что цепляется автоматически? Если нужны дополнительные переменные, то http://ipbskins.ru/forum/topic15758.html/page__view__findpost__p__105491 Link to comment Share on other sites More sharing options...
TemKa_SD Posted November 14, 2018 Author Share Posted November 14, 2018 Сейчас вывод выглядит так: http://prntscr.com/li58kq (шаблон), http://prntscr.com/li58rj (модуль). Добавляю новую переменную сюда: http://prntscr.com/li5ae4 (модуль), http://prntscr.com/li5ajm (шаблон), http://prntscr.com/li5a3d (результат). $headers, $rows уже не срабатывают. Link to comment Share on other sites More sharing options...
newbie Posted November 14, 2018 Share Posted November 14, 2018 А зачем Вы используете шаблон, который используется для строк? Link to comment Share on other sites More sharing options...
TemKa_SD Posted November 15, 2018 Author Share Posted November 15, 2018 Так, вот сделал следующее: создал вывод в шаблон: http://prntscr.com/lii41g сделал шаблон: http://prntscr.com/lii44i шаблон переменные принимает, всё в порядке. Как теперь это вставить на страницу сюда? : http://prntscr.com/lii48x Link to comment Share on other sites More sharing options...
newbie Posted November 15, 2018 Share Posted November 15, 2018 Если не получается с шаблонами, используйте extra$table->extra = array( 'filters' => array( 'years' => $years, 'months' => $months, ), ); В шаблоне вместо $years - $table->extra['filters']['years'], вместо $months - $table->extra['filters']['months'] Link to comment Share on other sites More sharing options...
TemKa_SD Posted November 16, 2018 Author Share Posted November 16, 2018 Совсем другое дело. Щас осталось как в пагинации справа добавить и всё: http://prntscr.com/lixn9e Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now