Editable picklist column
Posted By: nicocrm on March 12th, 2013 in Saleslogix
No Gravatar

By default the PickList column in SalesLogix 8 can display picklist values but not edit them.

Making it editable is a relatively easy process though:

  • The column must be marked as editable (Application Architect will not let you edit that one by default). You can accomplish that by editing the form’s XML.
  • The template needs to be edited to correctly output that editable flag (by default it is hard-coded to false). You can find the template under Model\QuickForms\Web\QFSDataGrid.WebControlScriptRenderingTemplate.vm, do a search for “PickListCol”, and change the “editable: false” to “editable: $generator.GetJavascriptBoolString(${col.IsEditable})
  • A little snippet of javascript needs to be added to ensure the grid is able to load the picklist widget – this can be loaded via a load action on the quickform:
    ScriptManager.RegisterStartupScript(this, GetType(), "PicklistColumn",
            // note the extra "require" for dijit is to account for the fact that 
            // the picklist file is not correctly requiring the base class
        @"require(['dojox/grid/cells/dijit'], function() {          
            require(['Sage/UI/Columns/PickList'], function(PickList) {
                PickList.extend({
    		getWidgetProps: function(val) {    
    		    return { pickListName: this.pickListName };
                    },
                    formatNode: function(inNode, dataItem, inRowIndex) {
                        // apply the properties corresponding to the current row to the widget 
                        // (by default the grid just reuses the same widget for all rows in the column)
                        this.inherited(arguments);
                        if(this.widget) {
                            this.widget.comboBox.set('value', dataItem);                    
                        }
                    }
                });
            });
        });", true);
    

I’m sure in the next version of SalesLogix this will be available by default.