Announcement

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

    Why is canSelectText false by default?

    I would like to understand why canSelectText is false by default. Wouldn't I want to be able to select all text just like with regular web applications? Is there a way to enable this globally?

    #2
    Yes. Look at the static functions available for almost all the widgets. There are functions for setting new global defaults that will be applied to any widgets created after the call.

    For Example:
    Code:
    ListGrid defaultGrid = new ListGrid();
    defaultGrid.setCellHeight(35);
    
    ListGrid.setDefaultProperties(defaultGrid);
    Now, all ListGrids instantiated after that call will have a cellHeight of 35 instead of the default which is 20 or 22 I think.
    Last edited by amcculley; 13 Dec 2012, 08:14.

    Comment


      #3
      Drag selecting text is mutually exclusive with any other drag operation, so this is not a good property to flip on globally - you will break all drag behaviors.

      Comment


        #4
        Originally posted by Isomorphic View Post
        Drag selecting text is mutually exclusive with any other drag operation, so this is not a good property to flip on globally - you will break all drag behaviors.
        Thanks, that's a good point.
        Your mileage may vary but I suspect that in general one has a lot more widgets that are /not/ draggable than ones that are. So, wouldn't it generally mean a lot less code i.e. work to disable drag-select on those?

        Comment


          #5
          No. If you use setDefaultProperties you are really setting something system-wide, even for AutoChildren and internal components, which means you will have a bunch of work ahead of you trying to revert the canDragSelect setting for draggable things like the Window corner resizer, each individual header button in a ListGrid, etc.

          Comment


            #6
            Good point.

            For us, nothing is dragged or resized so I've never seen it an issue but I can see how it could be for "out of the box" apps using SmartGwt.

            As a UX director, I find things like resize corners, resize bars, etc to be crutches for not really understanding what the users of an app want or need. We invest quite a bit of time and energy in understanding and customizing solutions for our users.

            That being said, there are several places where it makes sense. i.e. Creating an ad-hoc reporting / dashboard system, generic data interface, etc.

            Comment

            Working...
            X