LookupRenderers for non-editable columns in LABKEY.ext.EditorGridPanel | slangley | 2010-10-14 18:01 |
Status: Closed | ||
I'm using a hacked version of LABKEY.ext.EditorGridPanel where I have the autoSave property set to false - so that I'm invoking the saveChanges() function from another Javascript function in my app. One of the non-editable columns is a foreign-key lookup on another table, that is automatically displaying a text field next to the foreign-key in the other table. (All these tables are external schema-type tables in PostgreSQL). When in a webpage I make some edits to the editable fields in some row of my EditorGridPanel, followed by an invocation of the saveChanges() function to persist those changes. After saving, the EditorGridPanel refreshes. In the non-editable column that previously displayed the descriptive text from the foreign-key lookup table, instead, now appears the numeric foreign-key value. (I assume the LABKEY.ext.Store.onCommitSuccess() function is modifying the displayed row contents based on the content of the rows returned in the JSON response.) If I tweak this section of LABKEY.ext.EditorGridPanel from: getDefaultRenderer : function(col, meta) { if(meta.lookup && this.lookups && col.editable) //no need to use a lookup renderer if column is not editable return this.getLookupRenderer(col, meta); to: getDefaultRenderer : function(col, meta) { if(meta.lookup && this.lookups) return this.getLookupRenderer(col, meta); then things seem to work as I expect. That is, after a saveChanges(), my foreign-key-looked up text field continues to be displayed in place of the actual, non-editable, foreign-key values. Is this the right fix / work-around? Thanks. |
||