Issues with filter,sort,pagination combination - Joomla! Forum - community, help and support


hey people. im hew here. okay maybe 1 of first sentence of every newbie here o.o.
i'm working on own component (used book easy joomla development cocoate) , able understand stuff. have ground-knowing :p. have problems used whole framework , classes ^^.
but problem.

i have column-sort , pagination on backend. there absolutely no problem it. works charm.

now did same frontend. pagination works. column sort alone works too. example when sort column name, , go page 2 (or other) shows me choosen page without sort. sort disappeared. same every column.

another thing is, added search field on frontend. works too. same issue search , ordering+pagination. when search something, correct output. when sort columns or switching pages, search lost again.
but interesting part: when first sort name, , search something, sort still there o.o..

i don't know variables saved or not.... (when switch page , come back, choosen page , search gets saved , still there, sort gets lost).

so tell me please parts need. can't give link because installed local.

to save variables page page, store them in userstate/session variables, done japplication variable, on end if notice, there codes

code: select all

$app = jfactory::getapplication();
.
.
// save data user session
$app->setuserstate($this->context.'.data', $sorting);


by storing sorting variable on session state , not on model state, can go pages , different components without losing session data.

saving variables 1 thing, implementing sql query another, lists, use jmodellist , override getlistquery variable query database. on query, have add ordering , sorting on mysql query using sorting data saved session.





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support