Skip to main content

I am using a filter that sources it’s picklist options from another model.  I want the filter to remember the last selected filter value and have selected the tick box to enable that but the filter does not remember and resets to “all” on page load. Other filters on the table are able to remember just not the one using another model.

Do you have an example of where it’s not working for you? It seems like it’s working for me in this example -


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
<models>
<model id="AccountsOnMyOpps" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity" type="aggregate">
<fields>
<field id="Id" name="countId" function="COUNT"/>
</fields>
<conditions>
<condition type="userinfo" value="" field="OwnerId" fieldtargetobjects="User" operator="=" enclosevalueinquotes="true" userinfotype="userid"/>
</conditions>
<actions/>
<groupby method="simple">
<field id="AccountId" name="accountId"/>
<field id="Account.Name" name="accountName"/>
</groupby>
</model>
<model id="Opps" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
<fields>
<field id="Id"/>
<field id="Name"/>
<field id="StageName"/>
<field id="Type"/>
<field id="ForecastCategoryName"/>
<field id="Amount"/>
<field id="AccountId"/>
<field id="Account.Name"/>
</fields>
<conditions>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="AccountId" fieldtargetobjects="Account" state="filterableoff" inactive="true" name="AccountId"/>
</conditions>
<actions/>
</model>
</models>
<components>
<skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="false" model="AccountsOnMyOpps" buttonposition="" mode="readonly" allowcolumnreordering="true" responsive="true" uniqueid="sk-iu4-458" heading="AccountsOnMyOpps">
<fields>
<field id="Id" name="countId" uniqueid="fi-iu4-459"/>
<field id="AccountId" name="accountId" uniqueid="fi-iu4-460"/>
<field id="Account.Name" name="accountName" uniqueid="fi-iu4-461"/>
</fields>
<rowactions/>
<massactions usefirstitemasdefault="true"/>
<views>
<view type="standard"/>
</views>
</skootable>
<filterset model="Opps" searchmethod="server" searchbox="true" uniqueid="sk-iua-776">
<filters>
<filter type="select" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="manual" filtermethod="server" labelmode="no" condition="AccountId" filteroffoptionlabel="All Accounts">
<sources>
<source type="model" effectsbehavior="justdefault" model="AccountsOnMyOpps">
<labeltemplate>{{{accountName}}}</labeltemplate>
<valuetemplate>{{{accountId}}}</valuetemplate>
</source>
</sources>
</filter>
</filters>
<searchfields/>
</filterset>
<skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Opps" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-iuT-667" heading="Opps">
<fields>
<field id="Id" uniqueid="fi-iuT-668"/>
<field id="Name" uniqueid="fi-iuT-669"/>
<field id="AccountId" hideable="true" uniqueid="fi-ius-821"/>
<field id="StageName" uniqueid="fi-iuT-670"/>
<field id="Type" uniqueid="fi-iuT-671"/>
<field id="ForecastCategoryName" uniqueid="fi-iuT-672"/>
<field id="Amount" uniqueid="fi-iuT-673"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
<resources>
<labels/>
<javascript>
<jsitem location="inlinesnippet" name="onSelectUser" cachelocation="false">var eventId = argumentse0].event.Id;
var eventModel = skuid.model.getModel("SelectedUser");
var idCondition = eventModel.getConditionByName("SelectedUserId");
eventModel.emptyData();
eventModel.setCondition(idCondition, eventId);
eventModel.updateData();</jsitem>
<jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">var params = argumentse0],
$ = skuid.$;
console.log(params);</jsitem>
</javascript>
<css/>
<actionsequences uniqueid="sk-3N03-382">
<actionsequence id="c5ebd6f8-9dd1-4edf-93a2-6024935b6529" label="The Sequence" type="reusable" uniqueid="sk-FG8-316">
<description/>
<actions>
<action type="createRow" model="UI_Only" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context"/>
<action type="updateRow" fieldmodel="SelectedUser" affectedrows="context" field="hi" enclosevalueinquotes="true" value="{{$Model.SelectedUser.data.0.hi}}1"/>
<action type="custom" snippet="newSnippet"/>
</actions>
</actionsequence>
<actionsequence id="e85374dd-85a1-4320-9010-540ab0169269" label="The Sequence Popup" type="reusable" uniqueid="sk-FG8-316">
<description/>
<actions>
<action type="showPopup">
<popup title="New Popup" width="90%">
<components/>
</popup>
</action>
</actions>
</actionsequence>
</actionsequences>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Hi Matt,
Thanks for your help. In your example if you change the filter type to multi-select option then the filter fails to remember the last selected value, which is the problem I am having. I want to have a multi-select filter; when I changed it to select option the filter was able to remember, so we’ve isolated the problem (progress).
-











mu






































{{{accountName}}}
{{{accountId}}}
































var eventId = argumentst0].event.Id;
var eventModel = skuid.model.getModel(“SelectedUser”);
var idCondition = eventModel.getConditionByName(“SelectedUserId”);
eventModel.emptyData();
eventModel.setCondition(idCondition, eventId);
eventModel.updateData();
var params = arguments 0],
$ = skuid.$;
console.log(params);






























hello?


.


Reply