Skip to main content

I have added table in popup.
When I am opening that popup I need to reset the all the filter plus search box.

My Current problem
I am clicking on popup and searching anything into the search box.
After that when I am close the popup that search result appear again.
After that when i am trying with different text it is not give me any result.
So I need to reset model condition when I am clicking on popup.
So I have done below code but it is not working.Please provide some solution for that.
=========================
var params = arguments[0],
    $ = skuid.$;
var Job_Seekermodel1 = skuid.$M(“Job_Seeker”);
var searchCondition;
for (var i = 0; i < Job_Seekermodel1.conditions.length; i++)
{
 searchCondition = Job_Seekermodel1.conditionsni];
 Job_Seekermodel1.deactivateCondition(searchCondition);
 }


Job_Seekermodel1.updateData();
======================================


Functionally, the search box acts as a condition. Is it part of skuid.model.Model.conditions? That would be super-cool. and make it easier to ‘search’ with javascript. But if what Rohit is trying doesn’t work, then it’s probably not.

Rohit – have you tried a simple requery of the model? Does a requery reset the search?



We need to provide better APIs to get at the search condition on a model.  Also we need to prevent multiple search conditions from being created on the same model.  

In the mean time, try changing your code to only deactivate search conditions.  Put the following if statement around your deactivateCondition line.


if (searchCondition.name.indexOf('_searchbox') !== -1) { Job_Seekermodel1.deactivateCondition(searchCondition); }

Reply