Switch a single row in table from edit mode to read mode within an action sequence?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hi everyone,

I am trying to create a row action using the Run Multiple Actions framework. The idea is to save the changes in that row and switch it back to read mode while leaving the other unsaved rows in edit mode. Right now, I have done everything suggested in this answer https://community.skuid.com/skuid/topics/save-just-one-row-in-table and the changes from the row are saved, the problem is that the row stays in edit mode so there's no way to let the user know that the save has been completed. I think a snippet would solve this, but sadly I don't know how to code. . .

Thank you for your help!

Photo of Olya Slyusar

Olya Slyusar

  • 210 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Gregg Baxter

Gregg Baxter

  • 3,202 Points 3k badge 2x thumb
Hi Olya

What you could explore is using the field render enable options in the table on the specific field/s.  In combination using a Ui only field and a model action that updates the Ui only field to tell the page that the field has been edited and no longer enable also changing its background colour. I created a quick sample page based on a list of opportunities as a starting point for you to experiment with.  Just paste the following XML into a new page.

Happy Skuiding!

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <model id="OppsModel1C" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
                <field id="Id"/>
                <field id="Name"/>
                <field id="AccountId"/>
                <field id="Account.Name"/>
                <field id="Amount"/>
                <field id="Description"/>
                <field id="EditingMode" uionly="true" displaytype="BOOLEAN" label="Editing Mode" ogdisplaytype="TEXT" defaultvaluetype="fieldvalue" defaultValue="false"/>
                        <action type="updateRow" fieldmodel="OppsModel1C" affectedrows="context" field="EditingMode" enclosevalueinquotes="false" value="true"/>
        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="OppsModel1C" buttonposition="" mode="edit" allowcolumnreordering="true" responsive="true" uniqueid="sk-Wi0-310">
                <field id="Name" uniqueid="fi-Wi0-312">
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                    <enableconditions logictype="and">
                        <condition type="fieldvalue" operator="!=" enclosevalueinquotes="false" fieldmodel="OppsModel1C" sourcetype="fieldvalue" field="EditingMode" fieldtargetobjects="Opportunity" value="true"/>
                <field id="AccountId" uniqueid="fi-Wi0-313"/>
                <field id="Account.Name" uniqueid="fi-Wi0-314">
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                <field id="Amount" uniqueid="fi-Wi0-315"/>
                <field id="Description" uniqueid="fi-Wi0-316">
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                    <enableconditions logictype="and"/>
                <field id="EditingMode" hideable="true" uniqueid="fi-WiQ-631"/>
                <action type="multi" icon="sk-icon-edit" label="Edit">
                        <action type="updateRow" fieldmodel="OppsModel1C" affectedrows="context" field="EditingMode" enclosevalueinquotes="false"/>
                <action type="delete"/>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <view type="standard"/>
        <actionsequences uniqueid="sk-Whx-262"/>
        <styleitem type="background" bgtype="none"/>