[CLOSED] SplitButton overflow menu not shown correctly - follow up

  1. #1

    [CLOSED] SplitButton overflow menu not shown correctly - follow up

    I would like to return briefly to the closed issue SplitButton overflow menu not shown correctly. As stated in the initial post of this issue, the actual implementation is much more complex, and in fact, the entire toolbar is dynamically rendered on the server side (based on registered classes, application config, etc.).

    Although the proposed solution works well when defining a toolbar explicitly in the view, when the code is running on the server side (as faintly indicated in the first post), the layoutDone function is again causing the same error as before: Cannot read property 'measuresBox' of null.

    I ineffectively spent hours trying to find a reason (maybe another timing when creating controls on the server side) and finally decided to implement the following:

    Ext.override(Ext.layout.Context, {
        layoutDone: function (layout) {
            var ownerContext = layout.ownerContext;
            if (!ownerContext) ownerContext = this.getCmp(layout.owner); // ADDED. This setting should be ok because ownerContext.el.target.itemId is the same as when opening window with enough width to avoid showing split button overflow menu
            layout.running = false;
            if (layout.isComponentLayout) {
                if (ownerContext.measuresBox) {
                    ownerContext.onBoxMeasured();
                }
                ownerContext.setProp('done', true);
            } else {
                ownerContext.setProp('containerLayoutDone', true);
            }
            --this.remainingLayouts;
            ++this.progressCount;
        }
    });
    According to my findings, ownerContext property has the same value in both cases when the toolbar is fully shown and overflowed (when error occurs and the code I inserted is applied), so I think it "should work".

    In the same thread, it was also recommended to use the menuShow listener for split buttons (see post #5). However, I found out that this does not work when the overflow menu is displayed, but no submenu is invoked (Print Option 1 and 2 in the example). However, when replacing the menuShow listener with the MenuTriggerOver, everything works as expected.

    In any case, I do not want to question the recommendations published in the above-mentioned issue, they have been of great value to me. This post is rather meant as a small "installment" for all the good advice I received from the support team and I hope it can help somebody.

    I do not expect any response to this post, but if my conclusions are not correct, you can close it and hide to others.

    Thank you for all the effort you devote to us and for always highly professional approach.

    Dan
    Last edited by fabricio.murta; Nov 06, 2018 at 5:58 AM. Reason: thread does not require feedback from the user
  2. #2
    Hello Dan! Thanks for the post and the kind words, we really appreciate your time taken on both points!

    Quote Originally Posted by NewLink
    I would like to return briefly to the closed issue SplitButton overflow menu not shown correctly.
    You are always welcome to post on a thread marked as [CLOSED] if you have anything relevant to add to it. We just mark the thread as closed to point it was handled, but we don't actually lock it down from new posts.

    Quote Originally Posted by NewLink
    I do not expect any response to this post, but if my conclusions are not correct, you can close it and hide to others.
    We can't just say the conclusions are not correct, they work for you and that's a fact. Can't even say there may be pitfalls in the approach you've taken. If you have been having hard times simplifying the case down as to reflect your actual scenario yet focus on Ext.NET specific code in what you provided, there's no telling what may be influencing the results you get. So, it is just nice to have this feedback on a possible situation -and- the way you worked around it, that might just help other people facing the same issue in the future.

    We may mark this thread as closed as it does not require further assistance, but it nevertheless adds great backlog value to the forums, reason we believe it is best kept public -- just as we do with all forums' conversations.

    Thanks again for your feedback!
    FabrĂ­cio Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] SplitButton overflow menu not shown correctly
    By NewLink in forum 4.x Premium Help
    Replies: 11
    Last Post: Oct 10, 2018, 4:51 PM
  2. [CLOSED] Update SplitButton menu on DirectEvent?
    By rthiney in forum 2.x Premium Help
    Replies: 1
    Last Post: Jun 07, 2013, 5:10 AM
  3. [CLOSED] Updating the Overflow Menu
    By musher in forum 1.x Premium Help
    Replies: 5
    Last Post: Apr 25, 2012, 3:40 PM
  4. Replies: 2
    Last Post: Aug 02, 2011, 2:18 PM
  5. [CLOSED] Images in SplitButton Menu off
    By rthiney in forum 1.x Premium Help
    Replies: 1
    Last Post: Mar 01, 2010, 6:50 PM

Posting Permissions