Announcement

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

    When ListGrid 'Group by' option is disabled, give prompt explaining why

    When a ListGrid exceeds groupByMaxRecords, the various 'Group by x' options in the ContextMenus of the Header items are disabled.

    The end user has no way of knowing for what reason they are disabled.

    One solution would be to offer a prompt when the user hovers over the disabled item. Something like, "You cannot group by with more than x records".

    ListGridField's have prompt as property. Perhaps if they had disabledPrompt, you could use that.

    #2
    They are already such hovers. See Showcase.

    Comment


      #3
      I imagine you're meaning itemHoverHTML.

      That would be a great way to do it. All that's needed is an override point.

      As far as I can see, there is no groupByItemProperties. The item is hard-coded in getHeaderContextMenuItems:

      Code:
              menuItems.add({
                  groupItem: true,
                  title: this.getGroupByText(field),
                  fieldName: field.name,
                  targetField: field,
                  prompt: field.prompt,
                  icon: "[SKINIMG]actions/groupby.png",
                  click: function(target, item, menu) {
                      this.targetField.groupingMode = this.targetField.defaultGroupingMode || null;
                      menu.groupField(item);
                  },
                  enabled: this._shouldGroupByField(field),
                  canSelectParent: true,
                  submenu: groupBySubmenu
              });
      Currently, I've overridden getHeaderContextMenuItems to call the original and then modify the resulting array by looking for an item with the property groupItem: true.

      My suggestion is to improve end-user usability by making it easier (or perhaps even the norm) that when disabled due to exceeding groupByMaxRecords, the item has a default hover or prompt that explains this.

      Of course, the item can also be disabled because one of the other conditions of _canGroupByField dictates so, but that wouldn't be hard to work around. I am currently doing so in my method that I outlined above.

      In general I dislike overriding your native methods. It tends to be fragile and of course has a maintenance cost, too. In cases where it's something others might find beneficial, I like to share the idea.

      I understand if it's too niche and will continue to use my override if that's the case.

      Comment


        #4
        That's an interesting enhancement, but note that you can approximate these other placement options using a BlurbItem in the next or previous row, or previous column.????

        https://recipesny.com/2020/12/07/instant-pot-blender-recipes/
        Last edited by James017; 9 Dec 2020, 00:25.

        Comment

        Working...
        X