Please, ¿default sort order?

N

Netric

Guest
when displaying the search results (or all records) of a table, how can I sort by alphabetic order instead of the defautl order?

Thanks
 
P

Paul Sharpe

Guest
I'm not sure whether or not this will help but I believe I ran into a similar problem.

I was provided with a comma-delimited file exported from an MS Access database. This was the data I wanted to bring into DataBik. The first time I used it, the sort order of Databik was all messed up. I expected it to be alphabetical when using "all records". I looked back at the original comma-delimited file and saw that IT was not sorted alphabetically. I changed the sort of the comma-delimited file and then brought it back into DataBik. The sort in "all records" is now alphabetical.

Now that's fixed, there are still a couple of things driving me half nuts! In a regular search, I want to display all last names STARTING with a defined character. Let's say all last names starting with "T". The results produce a list of all names containing "T" anywhere in them.

Further, I cannot figure out how to change the height of the cells that are produced in a search result. I have re-sized the "details" image and that is an improvement but the cell it is displayed in does not re-size to be smaller. I think the default setting of the "details" image AND the cell are simply too large!

Hope some of this helps you and that someone might be able to help me.

THANK-YOU
 
K

Kristen

Guest
I was playing around with this, trying to get it to work, and I think this does it:

on form.php set the variable order to the field you want it to order by. In my case I did:

$order = "lastname";

I put it right before the switch statement in form.php that starts like:
switch($function){

If you put it at the beginning of the file it doesn't work, so be sure to put it right above the switch statement.

I am not a programmer or anything, so if this doesn't work I'm sorry!

Kristen
 
K

ken

Guest
the only problem with that solution is that your sort buttons at the top of the "show all" page no longer work.

I haven't figured out a solution for "search results", but a quick solution for "show all records" is to do the following:

edit the actual link. Find this line in the index.php:

<p><?php echo $normal_messages_ar["show_all_records"]; ?>

and replace it with the following:

<p><?php echo $normal_messages_ar["show_all_records"]; ?>


notice the &order=fieldname
enter the field name to sort on.


I'm still trying to find something that works for "search results", but this works good for "show all records"
 
K

Kristen

Guest
I found that it was just getting too much to figure out how to do this stuff, and after doing a little research it wasn't hard to write my own search program that didn't have the issues dadabik had. I'm still grateful it was there, since it is easy to set up, but when you want more customizability, it seems writing your own version of it might be easiest. If you need help, let me know. (Again, nothing against dadabik--for its intended purpose, it works well.)

Kristen
 
Top