re-enable quick search?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

re-enable quick search?

Post by D Oliveira » 2020-01-28 19:11

hello all, i have changed my tablename_view.php from:

Code: Select all

$x->ScriptFileName = "recipes_view.php";
to this:

Code: Select all

$mi = getMemberInfo();
if( $mi['groupID'] == '2' ){
	$x->ScriptFileName = "recipes_view.php";
}else{
	$x->ScriptFileName = "receitas_pdf.php";
}

the goal was to take the admin to detail view and user straight to the generated fpdf, all worked great with one exception... 'quick search' works fine for admin but doesnt work for user, does anyone know a way to re-enable quick search for the user? thank you

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: re-enable quick search?

Post by a.gneady » 2020-01-29 18:24

Hmm ... my guess is that the quick search form, for non-admin users, is now being submitted to 'receitas_pdf.php', which seems not to handle quick search the same way the _view file handles it.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: re-enable quick search?

Post by D Oliveira » 2020-01-29 19:49

a.gneady wrote:
2020-01-29 18:24
Hmm ... my guess is that the quick search form, for non-admin users, is now being submitted to 'receitas_pdf.php', which seems not to handle quick search the same way the _view file handles it.
exactly, I could switch back and put a window.location.replace in the table_dv function in the tablename.php file for the user to be redirected to the pdf but that delay is an awful user experience, any ideas how it could be worked around? already tried settimeout function in js and the delay seems to always be there

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: re-enable quick search?

Post by D Oliveira » 2020-01-29 20:13

solution: reset tablename_view.php, go to templates/tablename_templateTV.html

change this:

Code: Select all

<dt class="recipes-kcal-caption field-caption-tv">Calorias</dt>
<dd id="recipes-kcal-<%%VALUE(id)%%>" class="recipes-kcal h6 text-bold"><%%SELECT%%><%%VALUE(kcal)%%><%%ENDSELECT%%></dd>
to this:

Code: Select all

<dt class="recipes-kcal-caption field-caption-tv">Calorias1</dt>
<dd onclick="window.open('receitas_pdf.php?SelectedID=<%%VALUE(id)%%>');" class="recipes-kcal h6 text-bold"><%%VALUE(kcal)%%></dd>

make the file read-only, inside the pdf page create a button if groupID == '2' to allow admin to open the detail view page and edit stuff. hope it helps someone :)

Post Reply