When a table contains a drawer that contains a template field marked as read-only, the double-click event is being handled resulting in an “Uncaught TypeError: Cannot read property mode of undefined” exception.
Couple of notes:
- It appears that the dblclick handler is tracking any nx-field inside of the tbody which is leading to the exception since there is no outer tr in this particular situation.
- The exception appears to be benign and page functionality continues as expected but could lead to issue in the future if further processing were ever added to this code path.
Steps to reproduce:
- Create new page using XML below
- Preview page
- Expand drawer for any contact
- Double-click the value side of the template field
Actual Result:
Uncaught TypeError: Cannot read property ‘mode’ of undefined and processing halts
Expected Result:
No exception and double-click should not be handled in this situation since the field is not editable.
Sample XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="Contact" limit="" query="true" createrowifnonefound="false" sobject="Contact" doclone="" type="">
<fields>
<field id="Id"/>
<field id="Name"/>
<field id="FirstName"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Contact" buttonposition="" mode="read">
<fields>
<field id="Name"/>
</fields>
<rowactions>
<action type="drawer" label="View Details" icon="sk-icon-magic">
<drawer title="Drawer Area" width="90%" closehandle="true">
<components>
<basicfieldeditor showheader="true" showsavecancel="false" model="Contact" buttonposition="" mode="read" layout="">
<columns>
<column width="100%">
<sections>
<section title="Section A" collapsible="no">
<fields>
<field type="COMBO" valuehalign="" editmodebehavior="autopopup" allowhtml="false" readonly="true">
<label>Template Field</label>
<template>{{FirstName}}</template>
</field>
</fields>
</section>
</sections>
</column>
</columns>
<conditions>
<condition type="contextrow" field="Id" mergefield="Id"/>
</conditions>
</basicfieldeditor>
</components>
</drawer>
</action>
</rowactions>
<massactions usefirstitemasdefault="true"/>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>