This topic is locked
[SOLVED]

 Moving FIELDS in Visual Editor

12/14/2012 1:54:49 AM
PHPRunner General questions
bbarker author

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20410&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' /> I have a record with about 15 fields in it.

In VISUAL EDITOR, they all show up on a single row.
I'd like to create _two new rows below_it, and move 5 fields into each row.

But when I copy and paste the fields, they always display BLANK after I build the project.
Isn't there a way to distribute elements to a different row without diving into the HTML mode?

W
wildwally 12/14/2012

Bill, It has been my experience that you can drag and drop the field where ever you want; however, some of the advanced functionality is lost. To prevent losing any functionality you must move the couple items with the actual field. Again this is from my personal experience so there might be more or less from the officials, but this is what I've found.

  1. The BEGIN and END tags for the field need to surround the field. If not done right the results can be unpleasant. If you look at them prior to edit they will wrap the row tags.

{BEGIN example_fieldblock}<TR><TD>...label code...</TD><TD>..input field code....</TD></TR>{END example_fieldblock}


make sure these still wrap your field code. Now the tricky part comes into play when you start highly customizing your layouts to include mulitple items on the same rows. I've found that you need to move the BEGIN and END tags to the cell level of the table for this to work.

<TR>
{BEGIN example_fieldblock}<TD>...label code...</TD><TD>..input field code....</TD>{END example_fieldblock}
{BEGIN example1_fieldblock}<TD>...label code...</TD><TD>..input field code....</TD>{END example1_fieldblock}</TR>


2) The DIV tags should wrap the field as they do prior to any edit (review default layout).
3) The BEGIN and END tags for the labels need to be kept in place.

{BEGIN example_label}example{END example_label}


4) The final item to watch for but not as important is the class in the cell tags

<TD class="runner-cc runner-cc1">


as these will control the font and color (CSS) for the text within the cell.
So you can drag and drop items as you want, but you should be aware that you will need to move some with the field manually. But once you've done it a few times it becomes really easy to grab things from the HTML mode copy/cut/paste as you need with little problems.
Hope this helps.

Sergey Kornilov admin 12/14/2012

I assume you are talking about the List page.

  1. Add a new table row below the existing one.
  2. Move fields as desired.
  3. Switch to HTML mode to move {END grid_record} marker.
    Here is "normal" structure of that table row in PHPRunner.

{BEGIN grid_row}<TR class="runner-row style1 {$rowclass}" {$rowstyle} {$rowattrs}>{BEGIN grid_record}

<TD>...</TD>

<TD>...</TD>

<TD>...</TD>

{END grid_record}</TR>{END grid_row}


After second row is added:

{BEGIN grid_row}<TR class="runner-row style1 {$rowclass}" {$rowstyle} {$rowattrs}>{BEGIN grid_record}

<TD>...</TD>

<TD>...</TD>

<TD>...</TD>

{END grid_record}</TR>

<tr>

<TD>...</TD>

<TD>...</TD>

<TD>...</TD>

</tr>

{END grid_row}


Now you need to move {END grid_record} where it belongs.

{BEGIN grid_row}<TR class="runner-row style1 {$rowclass}" {$rowstyle} {$rowattrs}>{BEGIN grid_record}

<TD>...</TD>

<TD>...</TD>

<TD>...</TD>

</TR>

<tr>

<TD>...</TD>

<TD>...</TD>

<TD>...</TD>

{END grid_record}

</tr>

{END grid_row}
bbarker author 12/14/2012

Thanks WildWally and Sergey. That's the best explanation that I've ever seen on this "simple" procedure. I'll give it a try later tonight when I shift into coding mood. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=68979&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' />
Two comments/suggestions:

  1. This "simple" explanation is needed somewhere in the users manual. I read it for over an hour last night and couldn't get the logic figured out. Also, I searched many, many postings with no success. So --- maybe it needs to be added? Also to the WIKI??? A-Ha!!!
  2. Since it's such a "common function", maybe when you click on "INSERT ROW BELOW", the procedure SHOULD AUTOMATICALLY move the {END grid_record} to the new, proper position? Wouldn't that cut down on the help requests?
    Thanks again. I'll let you know how this works. The Visual Editor is one of the MOST IMPORTANT tools in the entire package - at least for us beginner hackers. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=68979&image=2&table=forumreplies' class='bbc_emoticon' alt=':blink:' />

bbarker author 12/16/2012


  1. This "simple" explanation is needed somewhere in the users manual...
  2. Since it's such a "common function", maybe when you click on "INSERT ROW BELOW", the procedure SHOULD AUTOMATICALLY move the {END grid_record} to the new, proper position? Wouldn't that cut down on the help requests?


Thanks. That worked. It allowed me to add 4 lines and move the FIELDS to different locations.
One thing that I couldn't do, which caused me a LOT of TIME and EFFORT, was that I couldn't DELETE COLUMNs after I had added new lines. Maybe another new function for the to-do list?