Announcement

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

    How to get rid of margin between FormItem and FormItem.icon

    Hi,
    I have a FormItem and use a FormItem.icon. I see in the html that Smartclient adds a margin of 3px between the FormItem and the icon. Is there a way to get rid of this margin? A style I can use?

    See the attached image, I would like the input and the button to be placed tightly together.

    Thanks!

    gr. Martin

    btw, here is the code I use to define the formitem and icon (it is part of a compound component so therefore this references):

    Code:
    		// add the combobox to the DynamicForm
    		this.setFields( [ {
    			selector :this,
    			showTitle :false,
    			showPickerIcon :true,
    			selectOnFocus :true,
    			icons : [ {
    				src :"org.openbravo.userinterface.selector/images/selectorButton.png",
    				width: 27,
    				height: 17,
    				showFocused: true,
    				showOver: true,
    				click :this.openSelectorWindow
    			} ],
    			width :this.width,
    			editorType :"comboBox",
    			displayField :this.displayField,
    			valueField :this.valueField,
    			optionDataSource :this.dataSource,
    			pickListWidth :this.width,
    			pickListFields :this.pickListFields,
    			getPickListFilterCriteria : function() {
    				var criteria = this.Super("getPickListFilterCriteria");
    				if (criteria === null) {
    					criteria = {};
    				}
    				
    				// the form can have an organization field,
    				// in the server it is used to determine the accessible orgs
    				// TODO: make this optional or make it possible to set the orgid html id
    				if (document.frmMain.inpadOrgId !== null) {
    					criteria[openbravo.Constants.ORG_PARAMETER] = inputValue(document.frmMain.inpadOrgId);
    				}
    				
    				// the additional where clause
    				criteria[openbravo.Constants.WHERE_PARAMETER] = this.selector.whereClause;
    				
    				// and sort according to the display field initially
    				criteria[openbravo.Constants.SORTBY_PARAMETER] = this.selector.displayField;
    				return criteria;
    			},
    			// when changed set the field
    			changed :this.setSelectorValueFromField
    		}]);
    Attached Files

    #2
    if you really want to do this, you can use icon.hspace or formItem.iconHSpace but note that both of these properties are undocumented and subject to change

    Comment


      #3
      Thanks! This worked perfectly.

      I will add a note that this is not-supported and may change over time.

      gr. Martin

      Comment


        #4
        is it hspace still the only and un-documented way of removing that 3px margin?

        I'm using it to obtain a formitem layout like those in
        http://www.smartclient.com/smartgwt/...y_picker_icons

        in that smartgwt 3.0 sample it seems that no special setting is required, but in smartclient 8.2 I couldn't find a way to remove those 3px until I found this old thread.

        As a side note, in the /pickers folder skin the _Down pickers are included, but the formitem icons aren't sensitive to the showDown setting, or am I missing something?
        Last edited by claudiobosticco; 23 Jan 2012, 13:31.

        Comment

        Working...
        X