This topic is locked
[SOLVED]

 hiding columns

5/3/2011 5:27:20 PM
PHPRunner General questions
D
duck author

on a list page with inline edit i have used the following to hide/ display 3 of the columns so it opens in edit mode, save all saves the values and switches 3 of the data columns

this works fine in chrome browser but the save function doesnt in firefox and internet explorer v8 doesnt reliably save and seems to need another click with the mouse in an open area to finish loading

  1. any ideas on firefox/ie compatibility appreciated
  2. ideas to save and redirect without modifying php runner source also appreciated
  3. Ive published the code as others with similar problem may find it useful and not get as frustrated as i am!
  4. top of page:--

    <script>

    function toggle(thisname) {

    document.getElementById('saveall_edited1').click()

    td=document.getElementsByTagName('div')

    for (i=0;i<td.length;i++){

    if (td[i].getAttribute(thisname)){

    if ( td[i].style.display=='none' ){

    td[i].style.display = '';

    }

    else {

    td[i].style.display = 'none';

    }

    }

    }

    }

    </SCRIPT>
  5. bottom of page

    {BEGIN record_controls}<SPAN id="record_controls{$id}"><SPAN

    class=buttonborder>

    <DIV name1="toggle"><INPUT class=button onclick="toggle('name1');" value="Save and View Results" type=button></DIV></SPAN><SPAN

    class=buttonborder>

    <DIV style="DISPLAY: none" name1="toggle"><INPUT class=button onclick=window.location.reload() value="Re-edit Entered Results" type=button></DIV></SPAN><SPAN><INPUT

    style="DISPLAY: none" id=saveall_edited1 type=hidden name=saveall_edited1><IMG

    alt=bullet src="images/icon_required.gif"> - Required fields</SPAN>

</SPAN>{END record_controls}
3) columns as required:-

<TH style="BACKGROUND-COLOR: #535484; WIDTH: 111px; WHITE-SPACE: nowrap" class=headerlist align=middle>

<DIV name1="toggle">{BEGIN Load_Time_fieldheader}<A class=tablelinks

name1="toggle" {$Load_Time_orderlinkattrs}><FONT color=#ffffff>Load

Time</FONT></A>{END Load_Time_fieldheader}</DIV>

<DIV style="DISPLAY: none" name1="toggle"><A class=tablelinks

{$Progress_orderlinkattrs}><FONT color=#ffffff>Status</FONT></A> </DIV></TH>

<TD style="BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #ffffff; WIDTH: 111px; WHITE-SPACE: nowrap" vAlign=middle>

<DIV style="TEXT-ALIGN: center" name1="toggle">&nbsp;{$Load_Time_value}&nbsp;sec</DIV>

<DIV style="TEXT-ALIGN: center; DISPLAY: none" name1="toggle">&nbsp;{$Progress_value} </DIV></TD>

D
duck author 5/6/2011



on a list page with inline edit i have used the following to hide/ display 3 of the columns so it opens in edit mode, save all saves the values and switches 3 of the data columns

this works fine in chrome browser but the save function doesnt in firefox and internet explorer v8 doesnt reliably save and seems to need another click with the mouse in an open area to finish loading

  1. any ideas on firefox/ie compatibility appreciated
  2. ideas to save and redirect without modifying php runner source also appreciated
  3. I've published the code as others with similar problem may find it useful and not get as frustrated as i am!
  4. top of page:--

    <script>

    function toggle(thisname) {

    document.getElementById('saveall_edited1').click()

    td=document.getElementsByTagName('div')

    for (i=0;i<td.length;i++){

    if (td[i].getAttribute(thisname)){

    if ( td[i].style.display=='none' ){

    td[i].style.display = '';

    }

    else {

    td[i].style.display = 'none';

    }

    }

    }

    }

    </SCRIPT>
  5. bottom of page

    {BEGIN record_controls}<SPAN id="record_controls{$id}"><SPAN

    class=buttonborder>

    <DIV name1="toggle"><INPUT class=button onclick="toggle('name1');" value="Save and View Results" type=button></DIV></SPAN><SPAN

    class=buttonborder>

    <DIV style="DISPLAY: none" name1="toggle"><INPUT class=button onclick=window.location.reload() value="Re-edit Entered Results" type=button></DIV></SPAN><SPAN><INPUT

    style="DISPLAY: none" id=saveall_edited1 type=hidden name=saveall_edited1><IMG

    alt=bullet src="images/icon_required.gif"> - Required fields</SPAN>

</SPAN>{END record_controls}
3) columns as required:-

<TH style="BACKGROUND-COLOR: #535484; WIDTH: 111px; WHITE-SPACE: nowrap" class=headerlist align=middle>

<DIV name1="toggle">{BEGIN Load_Time_fieldheader}<A class=tablelinks

name1="toggle" {$Load_Time_orderlinkattrs}><FONT color=#ffffff>Load

Time</FONT></A>{END Load_Time_fieldheader}</DIV>

<DIV style="DISPLAY: none" name1="toggle"><A class=tablelinks

{$Progress_orderlinkattrs}><FONT color=#ffffff>Status</FONT></A> </DIV></TH>

<TD style="BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #ffffff; WIDTH: 111px; WHITE-SPACE: nowrap" vAlign=middle>

<DIV style="TEXT-ALIGN: center" name1="toggle">&nbsp;{$Load_Time_value}&nbsp;sec</DIV>

<DIV style="TEXT-ALIGN: center; DISPLAY: none" name1="toggle">&nbsp;{$Progress_value} </DIV></TD>


As no one else fixed this I did it myself :-)

  1. my bad the broken save all link replaced with this correctly {BEGIN saveall_link}<SPAN

    class=buttonborder {$savealllink_span}><INPUT class=button value="Save all" type=button {$savealllink_attrs}></SPAN>{END saveall_link}
  2. replace all div's with span then it works great (change the js in 1)above to ref span instead of div as well)
    +Tech support gave me how to hide the edit icons- thanks guys