Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 Next > End >>
Re:removing filters in list
Date: 2008/12/21 00:33 By: ndee Status: CB Doc subscriber  
Karma: 16  
Platinum Joomlapolitan

Posts: 505
graphgraph
It did not stop bother me...

I hope it is fixed. Please check. Beside the fix of the Remove function I added a missing space to the select list and some double qoutes and the fitler -> filter typo.

All line numbers refer to admin.comprofiler.html.php shipped with CB 1.2 RC4.

I rewrote moveOption4 because it did not make sense:
a) second param was never used
b) for loop was useless and got never executed
c) the function does only cut of the last element of the array

I have not much experience with Javascript so please check if the function works right.

removed line 587-604
Code:

 function moveOption4(fromObjtoObj)     {       for(var fromObj.options.length 1>= 0i--)       {         if(fromObj.options[i].selected)         {           fromObj.options[i].selected false;           for(var ifromObj.options.length 1j++)           {             fromObj.options[j].text fromObj.options[1].text;             fromObj.options[j].value fromObj.options[1].value;           }           fromObj.options.length fromObj.options.length 1;           if(NS4)             history.go(0);         }       }     }



added:
Code:

          function moveOption4(fromObj)     {         fromObjIndex fromObj.selectedIndex;         fromObj.options[fromObjIndex].selected false;         fromObj.options[fromObjIndex] = null;     }



----
function getFilterList(selectObj); line 624-652
added else statement to make sure the variable filterfields is empty, without doing that it is not empty if you remove the last filter
Code:

     function getFilterList(selectObj) {         var filterfields='';         var j=0;         var advType=getObject('ft2');         var simType=getObject('ft1');         //alert(simType.checked);         if(simType.checked) {             selectAll(selectObj);             if(selectObj.selectedIndex != -1) {                 for(0selectObj.options.lengthi++) {                     if(j>0filterfields +=  ' AND ';                     filterfields +=  selectObj.options[i].value;                     j++;                 }                 //alert(filterfields);                 if(filterfields!="") {                     document.adminForm.filterfields.value="s("+filterfields+")";                 } else {                     document.adminForm.filterfields.value="";                 }             }         } else {             if(document.adminForm.advFilterText.value!="") {                 document.adminForm.filterfields.value="a("+escape(document.adminForm.advFilterText.value)+")";             } else {                 document.adminForm.filterfields.value="";             }         }     }



added else clause
Code:

     function getFilterList(selectObj) {         var filterfields='';         var j=0;         var advType=getObject('ft2');         var simType=getObject('ft1');         //alert(simType.checked);         if(simType.checked) {             selectAll(selectObj);             if(selectObj.selectedIndex != -1) {                 for(0selectObj.options.lengthi++) {                     if(j>0filterfields +=  ' AND ';                     filterfields +=  selectObj.options[i].value;                     j++;                 }                 //alert(filterfields);                 if(filterfields!="") {                     document.adminForm.filterfields.value="s("+filterfields+")";                 } else {                     document.adminForm.filterfields.value="";                 }             } else {                 document.adminForm.filterfields.value="";                 document.adminForm.advFilterText.value="";             }         } if(advType.checked) {             if(document.adminForm.advFilterText.value!="") {                 document.adminForm.filterfields.value="a("+escape(document.adminForm.advFilterText.value)+")";             } else {                 document.adminForm.filterfields.value="";             }         }     }



---
line 892, changed function call
Code:

 <input type=button onclick="moveOption4(this.form.filter,this.form.filterfieldlist);" value=" Remove ">



to
Code:

 <input type=button onclick="moveOption4(this.form.filter);" value=" Remove " />



minor changes in enclosed admin.comprofiler.html.php

Post edited by: ndee, at: 2008/12/21 00:51
###################
SPEED UP HELP, read first: Help us help you
###################
Click here to see the profile of this user The topic has been locked.

Re:removing filters in list
Date: 2008/12/21 00:52 By: ndee Status: CB Doc subscriber  
Karma: 16  
Platinum Joomlapolitan

Posts: 505
graphgraph
file..
File Attachment:
File name: admin.zip
File size:28871 bytes

###################
SPEED UP HELP, read first: Help us help you
###################
Click here to see the profile of this user The topic has been locked.

Re:removing filters in list
Date: 2009/01/16 15:40 By: beat Status: Admin  
Karma: 287  
Admin

Posts: 5828
graphgraph
Many thanks for the fix proposal.

Implemented the fix to this bug, without rewriting. This whole screen is scheduled for a completely cool jQuery rewrite after CB 1.2 Stable, so want to keep changes minimal for now.

So this identified issue is fixed for upcoming CB 1.2 Stable.
Beat (beat)
Community Builder Team Member

Before posting on forums: Read all CB Articles | Specially the FAQ | Help us help you
CB links: Subscribe to CB documentation | Our templates | Paid Subscriptions | Get Hosting | Our Forge
Visit my CB Profile | Read my CB Blog

--
help us spend more time coding by helping others in this forum, many thanks
Click here to see the profile of this user The topic has been locked.

<< Start < Prev 1 2 3 Next > End >>

CBSubs 1.0

CBSubs 1.0.3 released!

Find out more about the revolutionary new Joomla subscription system:

Info on CBSubs

CB 1.2.2 Documentation

Thank you bonus:

ProfileBook (+Blog) 1.2RC
ProfileGallery 1.2RC2
CB Privacy 1.0RC

What? Why? Where?

Click here for a yearly subscription: subscribe now

CB 1.2.2 Download

Community Builder 1.2.2
Stable and native for:
Joomla 1.5 & 1.0 & Mambo
(incl. CB 1.2.2 Installation pdf)
You need to be a registered member to download.

Full 180 pages updated
CB 1.2.2 documentation:
You need to be a CB doc subscriber to download.

CB Login