Popup Table Search Not Working

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
1) We use a popup with a table in it and a search box on it (in this example the Users object)
2) Open the popup and search for a name (this works as expected)
3) Close the popup
4) Open the popup. The problem is that the search criteria seems to still be active. However there is nothing to delete in the search box. So we are stuck with nowhere to go until we refresh the entire page!

Sample XML:
<skuidpage showsidebar="false" showheader="false">
<model id="Users" limit="20" query="true" createrowifnonefound="false" sobject="User">
<field id="Name"/>
<pagetitle model="Users">
<action type="popup" label="Test Popup" window="self">
<popup title="New Popup" width="800">
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Users" buttonposition="" mode="read">
<field id="Name"/>
<action type="edit"/>
<action type="delete"/>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
<view type="standard"/>

Photo of Ant Belsham

Ant Belsham

  • 1,022 Points 1k badge 2x thumb

Posted 6 years ago

  • 1
Photo of Ant Belsham

Ant Belsham

  • 1,022 Points 1k badge 2x thumb
Looks like switching to client side search clears the search everytime the popup is initated. Not a fullt robust mechanism, but should get me out of the current bind.
Photo of Josh Cutler

Josh Cutler, Official Rep

  • 874 Points 500 badge 2x thumb
Glad you were able to find a workable solution for your pop-ups!

Zach wrote about the client vs. server-side searches in a different post (What fields does a search box search?) that might be of interest to you: https://community.skuidify.com/skuid/topics/what_fields_does_the_search_box_search 

Zach's helpful response is the last bit of the post.

Photo of Ant Belsham

Ant Belsham

  • 1,022 Points 1k badge 2x thumb
Thanks Josh. This works in this instance, however, this is not a robust solution if we have lots of data rows. I assume you are acknowledging the bug and putting it on the roadmap for resolution? Thanks.
Photo of Zach McElrath

Zach McElrath, Employee

  • 56,134 Points 50k badge 2x thumb
Hi Ant,

Confirmed, this is a bug / user-experience inconsistency with Table server-side search. As you have expressed, the issue is that Search Conditions generated from search text entered in the Table's search box remain applied to the Model even after you close the Popup, but when you open the popup back up, the Table's search box does not reflect that there is search text applied.

Our solution for resolving this will be to to check whether search criteria has been applied to the Model, and attempt to use this to recreate the search text for the Table, so that when you open the Popup back up again, the previously-entered search text will still be applied.

We'll update this thread when the issue is resolved.


Photo of Jeff Rutter

Jeff Rutter

  • 1,232 Points 1k badge 2x thumb

Was this bug considered resolved on your side? Like Craig below I took Mordechai's solution and got it to work for our use case, but I'm just curious if this was every resolved since I can't find mention of it in the community.


Photo of Mordechai


  • 988 Points 500 badge 2x thumb
Here's a fix for this that should cover most if not all cases:

when the popup opens loop through the model conditions and deactivate all conditions that are not "inactive" and ARE "originalInactive". this will deactive all conditions besides for the search box. To deactivate the search box you can deactivate based on a few criteria on the condition:
  1. field is null
  2. subconditions.length > 0
  3. name contains "searchbox"

var reload = false;
var model = skuid.$M("model-name");
var conditions = model.conditions;
for (var i = 0; i < conditions.length; i++)
  var condition = conditions[i];
  if (!condition.inactive && condition.originalInactive)
    reload = true;
  else if (!condition.inactive && !condition.originalInactive)
    if (condition.field == null && condition.subConditions.length > 0 && condition.name.indexOf("_searchbox") != -1)
      reload = true;
if (reload)
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,970 Points 4k badge 2x thumb
We were having this same problem and Mordechai's solution worked perfectly. Thanks!