Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Showing fields used in formula builder

    Hi there,

    Is there any way to display the names of the fields that are used in formula builder? The letter mappings are useful and compact but it would be great to hover over the formula box or have an extra icon next to the formula box where the user can see the actual field names that are mapped to the letters being displayed in the formula.

    #2
    Just to clarify what you're asking for: When the formula builder is showing, the "Key" --> "Field Name" mappings are all listed out in the ListGrid displayed at the top of the builder.

    Can you clarify why that is not sufficient / why it would be beneficial to re-display this information next to the formula itself.

    Note - we have no immediate plans to make a change like this, but if you can give us some insight into why you consider this desirable we'll certainly take the suggestion on board for consideration.

    Comment


      #3
      Because that ListGrid at the top is only useful if you only have 5-6 available fields. More fields than that, and it is a lot of manual effort to review the mappings.

      We have hundreds of available fields in our main grid so we need some way to show them the mappings. Just some hover text or an icon you can use to display a pop-up would be really helpful for that reason.

      Comment


        #4
        I developed the patch necessary to show a formula map by hovering over the help icon or by showing the help window.

        1. Modify gertHoverText to include key > field mappings

        Code:
        		// Internal method that provides the default help-text when hovering over the helpIcon
        		getHoverText : function () {
        		    var output = isc.SB.create();
        
        		    //6/11/13
        		    //swap out formula with field names to show formula text
        		    var formulaVars = this.getBasicValueObject().formulaVars;
        		    var formulaFields = isc.getKeys(this.getBasicValueObject().formulaVars);
        		    formulaFields = formulaFields.sort();
        		    var j= formulaFields.length;
        		    
        		    if(j>0){
        			    output.append("<b>Curent Formula Map:</b> <P>");
        			    output.append("<ul>");
        
        					for(var i=0;i<j;i++){
        						var formulaFieldKey = formulaFields[i];
        						
        						var formulaFieldName = formulaVars[formulaFieldKey];
        						var formulaField = this.getFields().find("name",formulaFieldName);
        						if(formulaField!=null){
        							var formulaFieldTitle = stripTags(formulaField.title);
        				            output.append("<li> <b>", formulaFieldKey, ": </b> ", formulaFieldTitle, "<p>");
        						}
        					}		    
        					output.append("</ul><br>");
        		    	
        		    }
        		    //end 6/11/13
        		    
        		    
        		    output.append("<b>", this.helpTextIntro, "</b> <P>");
        		    output.append("<ul>");
        		    var index = isc.MathFunction.getRegisteredFunctionIndex(),
        		        functions = this.mathFunctions
        		    ;
        
        		    if (functions && functions.length > 0) {
        		        for (var i=0; i< functions.length; i++) {
        		            var item = index[functions[i]];
        		            output.append("<li> <b>", item.name, ": </b> ", item.description, "<p>");
        		            output.append("<i>usage: ", item.usage, "</i> </li>");
        		        }
        		    }
        		    output.append("</ul>");
        
        		    return output.toString();
        		},
        2. Modify formulaField keyUp event to dynamically update icon prompt via keyUp event

        Code:
        		formulaFieldDefaults: {
        		    type: "text",
        		    formItemType: "AutoFitTextAreaItem",
        		    height: 20,
        		    width: "*",
        		    hoverWidth: 300,
        		    keyUp : function () {
        		        this.form.creator.helpIcon.prompt = this.form.creator.getHelpText();
        		    },
        		    keyPress : function () {
        		        if (this.form.creator.autoTest) {
        		            this.fireOnPause("autoTest", {
        		                target: this.form.creator,
        		                methodName: "testFunction"
        		            }, this.form.creator.autoTestDelay);
        		        }
        		        
        		    }
        		},
        3. Update helpIcon prompt at end of InitWidget to default correctly for existing formulas

        Code:
        		//6/11/13..added updating of prompt to show helpText including Formula map
        		this.helpIcon.prompt=this.getHelpText();

        Comment

        Working...
        X