William,
You may want to add a Model Formula field to the same model that drives your table. Setup the field as a Checkbox and have it return true or false based on a comparison to your other model’s data. This will take care of getting the right value in context to compare and keep you declarative.
Here is a sample page that demonstrates this:
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Opportunity">
<models>
<model id="CurrentUser" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="User">
<fields>
<field id="CreatedDate"/>
</fields>
<conditions>
<condition type="userinfo" value="" field="Id" operator="=" enclosevalueinquotes="true" userinfotype="userid"/>
</conditions>
<actions/>
</model>
<model id="OppStages" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity" type="aggregate">
<fields/>
<conditions/>
<actions/>
<groupby method="simple">
<field id="StageName" name="stageName"/>
</groupby>
</model>
<model id="Opportunity" limit="100" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
<field id="StageName"/>
<field id="RenderAction" uionly="true" displaytype="FORMULA" label="RenderAction" ogdisplaytype="TEXT" readonly="true" returntype="BOOLEAN">
<formula>IF({{CreatedDate}}&gt;{{$Model.CurrentUser.data.0.CreatedDate}}, true, false)</formula>
</field>
</fields>
<conditions>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="StageName" operator="=" state="filterableoff" inactive="true" name="StageName"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Opportunity" uniqueid="sk-2A_j-199">
<maintitle>
<template>{{Model.labelPlural}}</template>
</maintitle>
<subtitle>
<template>Home</template>
</subtitle>
<actions>
<action type="savecancel" uniqueid="sk-2A_j-197"/>
</actions>
</pagetitle>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="CurrentUser" uniqueid="sk-2Lfl-269" mode="read">
<columns>
<column width="50%">
<sections>
<section title="Current User" collapsible="no">
<fields>
<field id="CreatedDate" uniqueid="sk-2Lfl-277"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="Section B" collapsible="no">
<fields/>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Opportunity" mode="read" allowcolumnreordering="true" uniqueid="sk-2A_j-213">
<fields>
<field id="RenderAction" hideable="true" uniqueid="fi-2Lfl-764"/>
<field id="Name" hideable="true" allowordering="true" uniqueid="fi-2A_c-930"/>
<field id="StageName" hideable="true" uniqueid="fi-2A_j-255"/>
<field id="CreatedDate" hideable="true" allowordering="true" uniqueid="fi-2A_c-931"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
<action type="multi" label="Conditionally Rendered Action" icon="sk-icon-config">
<actions/>
<renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Opportunity" sourcetype="fieldvalue" field="RenderAction" fieldtargetobjects="Opportunity" value="true"/>
</renderconditions>
</action>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
<filters>
<filter type="multiselect" createfilteroffoption="true" affectcookies="false" autocompthreshold="25" conditionsource="manual" filtermethod="server" labelmode="no" condition="StageName" filteroffoptionlabel="All Stages">
<sources>
<source type="model" effectsbehavior="justdefault" model="OppStages">
<labeltemplate>{{{stageName}}}</labeltemplate>
<valuetemplate>{{{stageName}}}</valuetemplate>
</source>
</sources>
</filter>
</filters>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
<actionsequences uniqueid="sk-2A_j-252"/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>
Bill, thank you for sharing this suggestion. I’m always glad to see declarative solutions!
Thanks Bill!
Sometimes the most simple solution is not the most apparent! I setup the formula field as you suggested. The only other thing I had to do was call a javascript snippet to evaluate the formula fields after the row is adopted into the ‘selected’ model.
var params = argumentse0],<br />$ = skuid.$;<br />skuid.component.getById('workitem-table').render();<br />var WorkItems = skuid.model.getModel('WorkItems');<br />WorkItems.evaluateFormulaFields();