How can qSelector as filter return all rows by default for qListView if no selection is made. - SharePoint Customization - SharePoint for All - Dell Community

How can qSelector as filter return all rows by default for qListView if no selection is made.

How can qSelector as filter return all rows by default for qListView if no selection is made.

This question has been answered by kenny.wu-quest

Hi,

I have a qSelector as filter connected to qListview (Employee).  qSelector has Department selections (IT, HR, Finance) that will filter the Employee qListView with selected Departments from filter.  I have "Show Empty Selection" checked. So itshows empty selection with  "-Select One-" as default for qSelector when page loads.   I hope my scenerio is clear up to this point.  My question is:

Why is the list initially returning ZERO rows when the -Select One- is selected?   How can I change it so that by default, itwill return all rows until any one of the department is selected.

Thanks.

Verified Answer
  • Hi Trav,

     

    Sorry, this is a bug in qSelector, I was assuming that you are connecting then with web part connection. I have created a bug for the team, the ID is #443821.

     

    I would like to provide below solution as a workaround:

    1. Open ezEdit in qListView, navigate to Custom Display;
    2. Write below script into Results Header:

    <script>

    var url = window.location;

    if(url.toString().indexOf('refresh') == -1)

    {

       if(url.toString().indexOf('?') == -1)

       {

         window.location.href = url+'?refresh=1';

       }

       else{

           window.location.href = url+'&refresh=1';

       }

    }

    </script>

     

    The script will refresh the page if the page is loaded in the first time.

     

    Kenny.

All Replies
  • Hi,

    We are experiencing the same issue.  Any advice would be very helpful.

    Thanks,

    Trav

  • Hi there,

     

    You can check “Turn Off Filtering When Empty Selection Is Chosen” check box in qSelector to turn of this feature.

     

    Kenny.

  • That option was already turned on.

    The CAML filter on the list is expecting a Session value.  On the initial load of the page, nothing is there, no session, nothing.  So nothing loads.  Now, after selecting a different value and then selecting the empty value from the qSelector it works.  It is just the initial load of the ASPX page that does not work.

    Does the CAML filter on the list need to be set up differently?

    Thanks,

    Trav

  • Hi Trav,

     

    Sorry, this is a bug in qSelector, I was assuming that you are connecting then with web part connection. I have created a bug for the team, the ID is #443821.

     

    I would like to provide below solution as a workaround:

    1. Open ezEdit in qListView, navigate to Custom Display;
    2. Write below script into Results Header:

    <script>

    var url = window.location;

    if(url.toString().indexOf('refresh') == -1)

    {

       if(url.toString().indexOf('?') == -1)

       {

         window.location.href = url+'?refresh=1';

       }

       else{

           window.location.href = url+'&refresh=1';

       }

    }

    </script>

     

    The script will refresh the page if the page is loaded in the first time.

     

    Kenny.

  • Awesome, at least there is a work around for now.

    Thanks Kenny,

    Trav