Announcement

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

    smartgwt custimze datechooser

    Hi all,

    Is there a way to apply a customized DateChooser to DateItem? I canīt see any method to provide custom DateChooser object. Iīd like to provide some list with valid dates to the chooser and disable all other dates. Is it possible?

    Thanks in advance

    Regards Rainer

    #2
    Add your own FormItemIcon and lauch your custom picker when clicked.

    Comment


      #3
      hi,

      thanks for your hint. This approach seems to work but there are a few open questions. Is it possible to hide/disable the auto generated icon of dateitem? How to get DateChooser Control in the foreground and is it possible to disable some dates (not only weekends) in the control? I`m eveluating migration from GWT-Ext to smartgwt and the described usage of dateitem is one important point to our project.

      Thanks for your help

      Regards Rainer

      Comment


        #4
        If you're calling setIcons() after superclass init, you should see the default icon wiped out. If not, please show code.

        There isn't currently support for visually showing some dates as not allowed, although of course you can reject the selection after the user makes it (and perhaps should a dialog indicating this). If you're interested in having an override point added to make this possible, consider becoming a customer (of support, or of the commercial license) to get the issue looked at sooner.

        Comment


          #5
          If you're calling setIcons() after superclass init, you should see the default icon wiped out. If not, please show code.
          I'm seeing two icons when calling setIcons() :/
          Attached screenshot.



          Code:
          	private class MyDateItem extends DateItem {
          		DateChooser chooser;
          		public MyDateItem() {
          			super();
          			//create our own chooser
          			chooser = new DateChooser();
          			FormItemIcon icon = new FormItemIcon();
          			icon.setSrc("[SKIN]DynamicForm/date_control.png"); //image URL changed in SmartGWT 1 vs 2.0
          			setIcons(icon);
          		}
          	}
          	
          	private Canvas getDateItemTest() {
          		VLayout layout = new VLayout();
          		
          		DynamicForm form = new DynamicForm();
          		MyDateItem date = new MyDateItem();
          		form.setItems(date);
          		
          		layout.addMember(form);
          		
          		return layout;
          	}
          Attached Files

          Comment


            #6
            It looks like you want to replace the special, default picker icon. If so, set showPickIcon to false.

            Comment


              #7
              Hello,

              I am trying to add new picker icons to FormItems (a plus or a minus or both which creates or removes the item). It works well with all of the FormItems, but not with the DateItem. I am using the setIcons() function.
              But the datechooser picker icon and the newly added icon(s) are not in one line. It looks like the same as on the screenshot by levi. I think the problem is that the datechooser icon is not a standard pickericon. It would be great if it would be a standard pickericon, or at least there would be a get method to get the datechooser icon and I would be able to add it with my other custom icons (and set showPickIcon to false).

              Is there any solution or workaround for this?

              Thanks!

              Comment


                #8
                This was already fixed - download 2.5.

                Comment


                  #9
                  Hi, i want to customize he appearance of the dateChooser too. I aim for the use of a different style for this component so I can choose the width and height of the cells, the whole ataChooser and he bottomButton too.

                  My main issue is that using the "silverwave"-theme (for example) the titles are clipped because the buttons width is not sufficient for the translated title ("cancel" -> "Abbrechen").

                  Is there a way to scale the width of the dateChooser and the bottomButtons so the button fits its caption?

                  Comment

                  Working...
                  X