[FX.php List] RE: looking for advice...

Jonathan Schwartz jonathan at eschwartz.com
Tue Jan 16 10:18:29 MST 2007


Alex,

I'd be interested to hear how others solve this 
problem because I face the same challenge both in 
FMP native and fx.php.

The method I use right now: a modifiable sort 
order with multiple digits.  I create my initial 
list in increments of 10:  (10, 20 ,30, 40 ,etc). 
If I later want to reorder #40 between 10 and 20, 
I simply give it a sort order of 11. 
Alternativesly, you can use decimals: 10.1, 10.2, 
etc.

While this works when changing a couple of 
records, it doesn't solve the challenge of moving 
entire blocks of records.  I think that I would 
use the concept of chapters in this case and 
allow users to order the chapters, which would 
bring along with the records which would a 
separate sort order within the chapter.

My 2¢,

Jonathan

>Hi John-
>
>Thanks for the response.
>
>I have something very similar to this working now.... My main problem is
>that I need an intuitive way for a user to order their recipes any way
>they wish for their printed book.  For example, if a recipe is the 30th
>in the list and they want to move it to 2nd, the sortID field in
>FileMaker will have to change on records 2-30.
>This number is needed so we can export the data into inDesign in the
>correct order.
>
>I'm stuck design wise on an intuitive way to allow the user to create
>this order, and also php-wise because loooping through 200 or so records
>and editing a field may take some time....
>
>Alex
>
>
>-----Original Message-----
>From: fx.php_list-bounces at mail.iviking.org
>[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of John Moed
>Sent: Tuesday, January 16, 2007 10:10 AM
>To: fx.php_list at mail.iviking.org
>Subject: [FX.php List] RE: looking for advice...
>
>Alex,
>
>Create a variable for sort parameter and sort field. You can either
>create
>hyper-links on the column headers that allow the user to click on them
>and
>change the sort order. I also create a sort type variable which tells
>the
>page what type of sort it is and a sort changed variable. If the user
>clicks
>on the "Recipe Name" column header, the sort parameter is set to
>"ascend",
>the sort field is set to "recipe", sort changed is set to "YES" and sort
>type is set to "recipeascend". Before your find request in the PHP, put
>an
>if...then...else statement
>Something like (off the top of my head):
>If ($_get(changesort=="YES")){
>$sorttype=$_get('sorttype');
>$sortfield=$_get('sortfield');
>$sortparam=$_get('sortparam');
>}else{}
>
>For each column header, have an if then else statement:
><?php If ($sorttype='recipeascend'){ ?>
><a
>href=recipe.php?sorttype=recipedescend&sortfield=recipe&sortparam=descen
>d&ch
>angesort=YES>Recipe</a>
><?php }?>
><?php Else if ($sorttype='recipedescend'){ ?>
><a
>href=recipe.php?sorttype=recipeascend&sortfield=recipe&sortparam=ascend&
>chan
>gesort=YES>Recipe</a>
><?php Else }{ ?>
><a
>href=recipe.php?sorttype=recipeascend&sortfield=recipe&sortparam=ascend&
>chan
>gesort=YES>Recipe</a>
><?php }?>
>
>There is probably a better way to do this, but it is working so far for
>me.
>I would be happy to hear suggestions.
>
>Thanks,
>John
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 

Jonathan Schwartz
FileMaker 8 Certified  Developer
Associate Member, FileMaker Solutions Alliance
Schwartz & Company
jonathan at eschwartz.com
http://www.eschwartz.com
http://www.exit445.com
415-381-1852



More information about the FX.php_List mailing list