Drop Down Filter in custom Component.. - Joomla! Forum - community, help and support


hi, developers.

i developing custom component, called classes , want create drop down filter, filters according seasons [ drop down filters, in component news feeds, have drop down list categories , when chose category renders , shows news feeds, in category ]. time want filter seasons in drop down list , show classes particular season.

i have component called seasons, input season [in db contains id, ordering, sezona], there input seasons want filter classes [in db id, ordering, sezona[here store seasons id], iedalijums].

can me? happy see code examples.. searched net trough can't find anything.

thanks, in advance, andris

hi,
look on component contact how works filter category when have contact list view.
the file have check following:
- administrator/components/com_weblinks/views/weblinks/view.html.php
, specially code

the following line allow maintain category selected.

$filter_catid = $mainframe->getuserstatefromrequest( $option.'filter_catid', 'filter_catid', 0, 'int' );


this create html list box
$lists['catid'] = jhtml::_('list.category',  'filter_catid', $option, intval( $filter_catid ), $javascript );

to create custom list (sample):

code: select all

  $db =& jfactory::getdbo();

  $menus[] = jhtml::_('select.option',  '-1', '- '. jtext::_( 'select menu' ) .' -' );
  $query = 'select id value, name text'
            . ' #__menu'
            . ' order name'
            ;
            $db->setquery( $query );
            $menus = array_merge( $menus, $db->loadobjectlist() );

            $menus = jhtml::_('select.genericlist',   $menus, 'filter_secid', 'class="inputbox" size="1" '. $javascript, 'value', 'text', $active );


i hope you!





Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor