Hi Folks i'm new to all of this stuff and wondered if anyone can help me, i'm looking to alter my layout.
1)Move the search box to the centre of the screen
2)no records are to be show unless search criteria is found
3)remove goto and next page
Thanks p.s be gentle
simple layout
Re: simple layout
In the datalist.php comment out the following lines to remove go to and next functions. (Warning, this will remove from all tables)
Around line 1043 comment out this line //$pagesMenu = $Translation['go to page'] . ' <select style="width: 90%; max-width: 8em;" class="input-sm ltr" id="' . $pagesMenuId . '" onChange="document.myform.writeAttribute(\'novalidate\', \'novalidate\'); document.myform.NoDV.value=1; document.myform.FirstRecord.value=(this.value * ' . $this->RecordsPerPage . '+1); document.myform.submit();">';
Around line 1099 comment out this line //$this->HTML .= $Translation['records x to y of z'];
Around line 1138 comment out this line //if($i < $RecordCount) $this->HTML .= '<button onClick="'.$resetSelection.' document.myform.NoDV.value=1; return true;" type="submit" name="Next_x" id="Next" value="1" class="btn btn-default btn-block"><span class="hidden-xs">' . $Translation['Next'] . '</span> <i class="glyphicon glyphicon-chevron-right"></i></button>';
Around line 1043 comment out this line //$pagesMenu = $Translation['go to page'] . ' <select style="width: 90%; max-width: 8em;" class="input-sm ltr" id="' . $pagesMenuId . '" onChange="document.myform.writeAttribute(\'novalidate\', \'novalidate\'); document.myform.NoDV.value=1; document.myform.FirstRecord.value=(this.value * ' . $this->RecordsPerPage . '+1); document.myform.submit();">';
Around line 1099 comment out this line //$this->HTML .= $Translation['records x to y of z'];
Around line 1138 comment out this line //if($i < $RecordCount) $this->HTML .= '<button onClick="'.$resetSelection.' document.myform.NoDV.value=1; return true;" type="submit" name="Next_x" id="Next" value="1" class="btn btn-default btn-block"><span class="hidden-xs">' . $Translation['Next'] . '</span> <i class="glyphicon glyphicon-chevron-right"></i></button>';
23.17
Re: simple layout
Thanks for you help it was very useful. I altered the datalist.php file but the above picture I didn't know what to do was it a file? to be edited
Thanks
Thanks
Re: simple layout
Hi,
you should try to avoid editing of core AppGini files as they will be regenerated once you modify and recreate your app.
In order to handle such changes you can use the hooks provided. You need to write some PHP / JS code to apply your changes.
you should try to avoid editing of core AppGini files as they will be regenerated once you modify and recreate your app.
In order to handle such changes you can use the hooks provided. You need to write some PHP / JS code to apply your changes.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: simple layout
Hi pmartin
You could always set the search to 0 removing it completely and make a custom search box to suit your needs.
https://bigprof.com/appgini/tips-and-tu ... arch-forms
pböttcher is also correct, regenerating your app will override these changes and will need to be reloaded again,
You could always set the search to 0 removing it completely and make a custom search box to suit your needs.
https://bigprof.com/appgini/tips-and-tu ... arch-forms
pböttcher is also correct, regenerating your app will override these changes and will need to be reloaded again,
23.17
Re: simple layout
Where is the setting 0 for the search?
https://bigprof.com/appgini/tips-and-tu ... arch-forms
too complex for me in I know no php code, was under the influence this software did it all, anyway im getting there I just need to
trip my database up so it look better.
www.othertondesign.com/stolenmh
https://bigprof.com/appgini/tips-and-tu ... arch-forms
too complex for me in I know no php code, was under the influence this software did it all, anyway im getting there I just need to
trip my database up so it look better.
www.othertondesign.com/stolenmh
Re: simple layout
Firstly I would like to say a big thank you for all your previous help.
So along the way I have managed to setup a few things but still need help on my layout and are hoping someone can help me.
not sure if anyone understands but when searched and found I just want it to display the details view page and not the other table
So along the way I have managed to setup a few things but still need help on my layout and are hoping someone can help me.
not sure if anyone understands but when searched and found I just want it to display the details view page and not the other table
Re: simple layout
Hi,
there are several tasks:
Modification for task 1
file: hooks/TABLENAME.php
function: TABLENAME_header
Modification for tasks 2 and 3
file: hooks/TABLENAME-tv.js
Result
The screen recording below shows three scenarios:
Bonus
Automatic focus on Searchterm input box + select all text on focus for a better search-experience.
I hope this is what you were looking for. If not, I also recommend building a custom search-/filter-form, as someone has already mentioned before.
Best,
Jan
Todo:
In PHP code for task 1 (see above) there probably should be some better string sanitization before settings variable appgini_searchstring. I did not test with searchstrings having code fragments. Gonna leave it "as is" for the gurus here for optimization.
there are several tasks:
- hide table-view and top-buttons in the beginning.
- if there is exactly one match, redirect to detail view and show exactly that one record
- if there is more than one match, show table view as usual
Modification for task 1
file: hooks/TABLENAME.php
function: TABLENAME_header
Code: Select all
function TABLENAME_header($contentType, $memberInfo, &$args)
{
$header = '';
switch ($contentType) {
case 'tableview':
$header = '<%%HEADER%%><style>.table_view, #top_buttons { display: none; }</style><script>var appgini_searchstring="' . stripslashes($_REQUEST["SearchString"]) . '";</script>';
break;
// keep the rest of the default code
// ...
Modification for tasks 2 and 3
file: hooks/TABLENAME-tv.js
Code: Select all
$j(document).ready(function () {
// bonus :-)
$j("input[name='SearchString']").on("focus", function () {
$j(this).select();
})
var count = $j("tr[data-id]").length;
if (count == 1) {
var id = $j("tr[data-id]:eq(0)").attr("data-id");
if (id) {
var url = AppGini.currentTableName() + "_view.php?SelectedID=" + id;
window.location.href = url;
}
} else if (count > 1 && appgini_searchstring.length) {
$j(".table_view,#top_buttons").css("display", "unset");
} else {
$j("input[name='SearchString']").focus();
}
});
The screen recording below shows three scenarios:
- no searchstring = no tableview
(also: no matches = no tableview) - searchstring + multiple matches = table view showing all matches
- searchstring + one match = detail view showing exactly that one match
Bonus
Automatic focus on Searchterm input box + select all text on focus for a better search-experience.
I hope this is what you were looking for. If not, I also recommend building a custom search-/filter-form, as someone has already mentioned before.
Best,
Jan
Todo:
In PHP code for task 1 (see above) there probably should be some better string sanitization before settings variable appgini_searchstring. I did not test with searchstrings having code fragments. Gonna leave it "as is" for the gurus here for optimization.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools