conditional tab icons based on field values

Conlan O'RourkeConlan O'Rourke ✭✭✭✭
edited June 25 in Ideas
As the user progresses through the wizard, it would be nice to conditionally display a completion  icon for each tab.

The progress component bar is nice, but if the users want to hop around or close out and come back later (they do), there is currently no way to indicate how much they have already completed.

I've already built checkbox fields, which are updated as the user completes the info on each tab. Now I just need some nice way to display the status of those checkbox fields.


Something like this...except icons would be rendered dynamically instead of statically
image



1
1 votes

Under Consideration · Last Updated

Comments

  • Pat VachonPat Vachon 💎💎💎
    edited June 25
    I'm sure there's a solution via js. ;)
  • edited October 2017
    Conlan,

    How about a template component?  This example is based on check box fields.  You should be able to adapt it to your solution.
    image
    <skuidpage unsavedchangeswarning="" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <models>
            <model id="UIOnlyModel" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true">
                <fields>
                    <field id="Ind1" displaytype="BOOLEAN" label="Ind1" ogdisplaytype="TEXT" defaultvaluetype="fieldvalue" defaultValue="true"/>
                    <field id="Ind2" displaytype="BOOLEAN" label="Ind2" ogdisplaytype="TEXT" defaultvaluetype="fieldvalue" defaultValue="false"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
        </models>
        <components>
            <template multiple="false" uniqueid="sk-1OJfGR-136" allowhtml="true" model="UIOnlyModel">
                <contents>&lt;style&gt;
    table.GeneratedTable {
      width: 100%;
      background-color: #ffffff;
      border-collapse: collapse;
      border-width: 5px;
      border-color: #ffffff;
      border-style: solid;
      color: #000000;
      cellpadding="10";
    }
    table.GeneratedTable td, table.GeneratedTable th {
      border-width: 5px;
      border-color: #ffffff;
      border-style: solid;
      padding: 6px;
      font-size: 32px;
      color: #ffffff;
      valign: middle;
    }
    table.GeneratedTable thead {
      background-color: #ffffff;
    }
    &lt;/style&gt;
    &lt;table class="GeneratedTable"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          {{#Ind1}}&lt;td style="background-color: #000099"&gt;&lt;i class="sk-webicon  " aria-label="thumbs o up" role="img"&gt;&lt;svg viewBox="0 0 24 24"&gt;&lt;use xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="/resource/skuid__IconsSVG/font-awesome/font-awesome.min.svg#thumbs-o-up"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/i&gt; Step 1&lt;/td&gt;{{/Ind1}}{{^Ind1}}&lt;td style="background-color: red"&gt;&lt;i class="sk-webicon  " aria-label="thumbs o down" role="img"&gt;&lt;svg viewBox="0 0 24 24"&gt;&lt;use xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="/resource/skuid__IconsSVG/font-awesome/font-awesome.min.svg#thumbs-o-down"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/i&gt; Step 1&lt;/td&gt;{{/Ind1}}
          {{#Ind2}}&lt;td style="background-color: #000099"&gt;&lt;i class="sk-webicon  " aria-label="thumbs o up" role="img"&gt;&lt;svg viewBox="0 0 24 24"&gt;&lt;use xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="/resource/skuid__IconsSVG/font-awesome/font-awesome.min.svg#thumbs-o-up"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/i&gt; Step 2&lt;/td&gt;{{/Ind2}}{{^Ind2}}&lt;td style="background-color: red"&gt;&lt;i class="sk-webicon  " aria-label="thumbs o down" role="img"&gt;&lt;svg viewBox="0 0 24 24"&gt;&lt;use xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="/resource/skuid__IconsSVG/font-awesome/font-awesome.min.svg#thumbs-o-down"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/i&gt; Step 2&lt;/td&gt;{{/Ind2}}
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;</contents>
            </template>
            <buttonset model="UIOnlyModel" uniqueid="sk-1OVIgr-731">
                <buttons>
                    <button type="multi" label="Toggle Step 2" uniqueid="sk-1OVIxg-736" icon="sk-webicon-font-awesome:thumbs-o-up">
                        <actions>
                            <action type="branch" model="UIOnlyModel">
                                <formula>{{Ind2}}===true</formula>
                                <iftrueactions>
                                    <action type="updateRow" fieldmodel="UIOnlyModel" affectedrows="context" field="Ind2" enclosevalueinquotes="true" value="false"/>
                                </iftrueactions>
                            </action>
                            <action type="updateRow" fieldmodel="UIOnlyModel" affectedrows="context" field="Ind2" enclosevalueinquotes="true" value="true"/>
                        </actions>
                    </button>
                </buttons>
            </buttonset>
        </components>
        <resources>
            <labels/>
            <javascript/>
            <css/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>
    Thanks,

    Bill
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited June 25
    Conlan, I don't think there's any straightforward declarative way to accomplish this right now. I've added it to our backlog as an Idea under consideration.
  • Pat VachonPat Vachon 💎💎💎
    edited October 2017
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited October 2017
    There was actually a regression in the Brooklyn Q2 release (10.x) that caused merge syntax to no longer work in tab icons --- but even then, the icon did not dynamically update, it was only evaluated on initial tab render.
  • Pat VachonPat Vachon 💎💎💎
    edited October 2017
    That's what I thought. Trying to think of a declarative way to update the CSS to set element to display: none; Can otherwise do this with js.

    Is this included as an Idea under consideration?

    Are we ever going to see a more transparent set of Ideas? ie.  under consideration vs. targeted for next release?
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited October 2017
    Yes this is under consideration. 
    We are working toward more transparency on release timelines for ideas under consideration.
  • Pat VachonPat Vachon 💎💎💎
    edited October 2017
    Lol! Is there a timeline for this?
  • Conlan O'RourkeConlan O'Rourke ✭✭✭✭
    edited October 2017
    Thanks for the input, Zach! This one would definitely be nice to have. It's currently not a must-have for the client, but would improve the UX. 

    I was able to accomplish something similar on a table by simply rendering different row actions based on another checkbox field value in the row...but I can't think of how to do this in a non-table context...other than putting in a bunch of field editors tied to different models inside a responsive grid, but that feels very messy to me.

    Pat, I'm going to try and hack away at this a little bit and take a look at Bill's example. If I get frustrated enough, I may ping you for that JS help.


  • Conlan O'RourkeConlan O'Rourke ✭✭✭✭
    edited October 2017
    So demanding Pat! :)
  • Pat VachonPat Vachon 💎💎💎
    edited October 2017
    Always
Sign In or Register to comment.