Jump to content

This topic is 8293 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

i'm performing a find and want to return the results. each result must be in an html <table> or <div> tag. thats just how it has to be, trust me. the problem is, i want to tile the results across the screen, from left to right, and then top to bottom.

i cant think of any way to do this with any of the CDML tags. any help?

Posted

<table border="0" cellspacing="0" cellpadding="0">

<tr>[FMP-Record]

<td>[FMP-Field: field1]</td>

[/FMP-Record]</tr>

</table>

is a start for horizontal search results but can you give me some more info on how it should be on screen?

Just one field?

Is it not possible to create a calculation field "newrow" that says:

If(Mod(Status (CurrentRecordNumber), 10)=0, "</tr><tr>", "")

it should look like this than:

<table border="0" cellspacing="0" cellpadding="0">

<tr>[FMP-Record]

<td>[FMP-Field: field1]</td>[FMP-Field: newrow]

[/FMP-Record]</tr>

</table>

edit: if it works please let me know and if I made some mistakes, I will post it on http://www.ib2.nl/filemaker/ then. You also may submit it of course smile.gif

Posted

hi,

that is exactly what i needed. i hadn't thought of the Status(CurrentRecordNumber) thing. thanks a million,

tim.

Posted

Here is a Javascript for placing a sorted find into three colums:

	<script language="Javascript">

var z = 0;

var aCustomers = new Array();

var aCustomerIDs = new Array();

var iCustCount = [FMP-CurrentFoundCount] ;

var rows = Math.ceil(iCustCount / 3) ;

[FMP-Record]

aCustomers[z] = "[FMP-Field:cust_name, raw]" ;

aCustomerIDs[z] = "[FMP-Field:cust_id]" ;

z += 1 ;

[/FMP-Record]

function addbusiness(cust)

{

var cust ;

document.newquotefm.cust_id.value = cust ;

document.newquotefm.submit() ;

}

</script>

</head>

<body><form name="newquotefm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post'>

<input type="hidden" name="-db" value="quotes.fp5">

<input type="hidden" name="-lay" value="web">

<input type="hidden" name="-format" value="/digi_lan/editquote.html">

<input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]">

<input type="hidden" name="-token.1" value="[FMP-CurrentToken:1]">

<input type="hidden" name="-token.2" value="[FMP-CurrentToken:2]">

<input type="hidden" name="prepared_by" value="[FMP-ClientUsername]">

<input type="hidden" name="cust_id">

<input type="hidden" name="-new">

Click on a Customer Name for new quote:

<table>

<script>

for(j = 0; j< rows; j++)

{

document.write("<tr><td><a href=Javascript:addbusiness('" + aCustomerIDs[j] + "');>" + aCustomers[j] + "</a></td>");

document.write("<td><a href=Javascript:addbusiness('" + aCustomerIDs[j + rows] + "');>" + aCustomers[j + rows] + "</a></td>");

document.write("<td><a href=Javascript:addbusiness('" + ((aCustomerIDs[j + (2 * rows)] === (void 0)) ? '':(aCustomerIDs[j + (2 * rows)])) + "');>" + ((aCustomers[j + (2 * rows)] === (void 0)) ? '':(aCustomers[j + (2 * rows)])) + "</a></td></tr>");

}

</script>

</table></body>

The results run sorted down a colum then onto the next colum.

Hope this is of interest.

Garry

Posted

The CDML is a good method, nice and neat! However, the Javascript is good if you want to take some of the processing away from the server, and if you want to 'fiddle' with sorts and the direction in which they are displayed.

It is one I used some time ago, so it has just been copied-and-pasted from that application.

Good to see a couple of alternatives. smile.gif

All the best.

Garry

Posted

I just read Timmys post on the ODBC forum. Here is a simple method:

<table><tr>

<script>i = 1 ; nCols = 3 ;[FMP-Record]

if ((i % nCols) == 0)

{ document.write("<td>[FMP-Field:name]</td></tr><tr>") ; }

else

{ document.write("<td>[FMP-Field:name]</td>") ; } ;

i++ ;[/FMP-Record]

</script></tr></table>


This is as straightforward as ASP, PHP etc. wink.gif

All the best.

Garry

Posted

Sharky.

It doesn't work for me. It works fine when I'm doing a find all, but when I search for anything, it seems that the Current Record Number doesn't get updated. I posted a question on this in this forum. Thanks for the help,

Tim.

This topic is 8293 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.