This topic is locked

Buttns for - show all, show assigned, show completed etc.

10/11/2012 4:28:21 AM
PHPRunner General questions
I
Ian_Emerald author

Hi,
Apologies if this has been answered before but I couldn't find anything when searching.
I have a runner site that shows a team a list of jobs in the List view.

The default filter is to show non completed jobs that are either assigned to them or not yet assigned.

However we also need a set of buttons to change what is displayed to show selections such as 'show all' 'show completed' etc. so that they can see other data as well as the default filter.
There are code snippets I can add to modify the where to change the filter such as:

function OnBefore(params,ctrl)

{

$query->replaceWhere(" jobStage='complete' ");

}
However I am stuck on how to get it to then re-run the query and reload the page with the new data.

(I can do all I need for this task with new where clauses, but can redo the whole sql if that helps)
Anyone know the best way to do this?

A) Change the where clause

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20148&image=1&table=forumtopics' class='bbc_emoticon' alt='B)' /> Re-run the query

C) Load the new data

I
Ian_Emerald author 10/11/2012

I was hoping there might be a 'I have changed the query please re-run and reload' command to go with the 'changeWhere' commands. Afterall what use is changing the query without one?

oh well! Will have to do it the long winded way.

Sergey Kornilov admin 10/11/2012

I believe there is a simpler way to do that. Simply point each button to one of search results pages. Run a search first using advanced search or a search panel. Copy and paste each search results URL into each button ClientBefore code. Here is example of redirect in ClientBefore event:

location.href="http://cnn.com";;