Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Collapse All Expanding Menus On A UX?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Collapse All Expanding Menus On A UX?

    I am on build 5221-5152 (haven't had time update for many months).

    I am setting up several expanding menus on a UX as a navigation system for my users. If a user clicks to expand one, and then another, I do NOT close the first one (on purpose) so that they have quick access to the ones they opened when they return to the UX. I have looked everywhere for code to collapse all of the expanding menus at once, if user clicks a button that I will label Collapse All. Does anyone know how to do this?
    Carol King
    Developer of Custom Homebuilders' Solutions (CHS)
    http://www.CHSBuilderSoftware.com

  • #2
    Re: Collapse All Expanding Menus On A UX?

    This functionality was added in 5151-5127

    Link to Alpha Video on it.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

    Comment


    • #3
      Re: Collapse All Expanding Menus On A UX?

      Thanks so much, Mike, but that video is about collapsing nodes from WITHIN one expanding menu. I want to be able to collapse expanding menus by using a button that is not within the menus.

      As you can see from my attached screenshot, I have 22 expanding menu elements on one ux and want to click one button to collapse them all. I want the user to be able to leave expanding menus expanded so that when they return to the ux, the ones they have expanded are still expanded. But, then, give them a way to collapse them all at once. I don't want them to have to click on each one they've expanded in order to collapse them.

      Below is the code in Selwyn's video about collapsing nodes from within an expanding menu. On my Collapse All button, I have tried using {dialog.object}.collapseMenu(name of my expanding menu, its value); and various iterations of that, but get an error saying that collapseMenu is not recognized.

      var parent = 'value of parent node';
      this.collapseMenu(parent);
      Attached Files
      Carol King
      Developer of Custom Homebuilders' Solutions (CHS)
      http://www.CHSBuilderSoftware.com

      Comment


      • #4
        Re: Collapse All Expanding Menus On A UX?

        I see now. I'm not sure if there is a collapse all menu function available. I couldn't find one.

        I was able to get Selwyn's example working (from a node's onClick event) but the collapseMenu() function is really just a expand/collapse toggle. If I run the code twice the menu node collapses and then expands again. So even if you used the function to "collapse" every node in every menu you'd first have to evaluate if the node is collapsed already first and skip over those. I didn't get that far.

        Ashampoo_Snap_Sunday, July 28, 2019_07h19m50s_001_.png
        Mike Brown - Contact Me
        Programmatic Technologies, LLC
        Programmatic-Technologies.com
        Independent Developer & Consultant

        Comment


        • #5
          Re: Collapse All Expanding Menus On A UX?

          I have the same need. I'm working on a quote system that requires selecting the quote to work on, then going to various tabs to do the work. So, it requires closing all the tabs prior to starting on the next quote. Otherwise, the user is left working on the old quote.

          I have a button that closes all the tabs, but I'd like it to close the menu buttons also. I'm wondering if it is possible to get the status of a button and "click" it to toggle closed the leafs.
          Pat Bremkamp
          MindKicks Consulting

          Comment


          • #6
            Re: Collapse All Expanding Menus On A UX?

            Just to let you know, Glenn Schild has been needing this too, and has said that he has put in a feature request for it. I just wondered if anyone had managed to come up with a solution on their own. Plus putting this out there will perhaps let us know of others who need the feature, like Pat, etc.
            Carol King
            Developer of Custom Homebuilders' Solutions (CHS)
            http://www.CHSBuilderSoftware.com

            Comment


            • #7
              Re: Collapse All Expanding Menus On A UX?

              Originally posted by kingcarol View Post
              Just to let you know, Glenn Schild has been needing this too, and has said that he has put in a feature request for it. I just wondered if anyone had managed to come up with a solution on their own. Plus putting this out there will perhaps let us know of others who need the feature, like Pat, etc.
              Actually Carol, not quite but very similar, my scenarios is that I am using the expanding menu within a tree control on a tabbedui, and the value features for the expanding menu are not exposed in that scenario. Having said that the xbasic to collapse is

              this.collapseMenu('menu_name');

              so I am wondering if you replace "this" with the explicit object name for the first expanding menu and then repeat for each menu, if that might work?
              Glen Schild



              My Blog

              Comment


              • #8
                Re: Collapse All Expanding Menus On A UX?

                Have you followed the instructions in this video.
                C:\Users\petec\Downloads\ux_componen...llapseMenu.swf

                Cheers Pete
                Insanity: doing the same thing over and over again and expecting different results.
                Albert Einstein, (attributed)
                US (German-born) physicist (1879 - 1955)

                Comment


                • #9
                  Re: Collapse All Expanding Menus On A UX?

                  As Michael points out, collapseMenu() is buggy... since it Expands a menu as well. I'm guessing whomever created the method didn't actually run it twice in a row. This makes sense given the wretched doc for this method... here's the doc... can you find the 2 bugs in it? I'm shaking my head. This is why Alpha is so frustrating these days.

                  Code:
                  ' Get the object for the 'EXPANDINGMENU_1' control
                  var menuObj = {dialog.object}.getControl('EXPANDINGMENU_1');
                  if (menuObj) {
                      var parent = 'B1';
                      menuObj.collapseNode(parent);
                  }
                  Anyway... attached is a sample UX which works around the "un-intended feature" of collapseMenu()... and also hijacks a property of the menu object... "state". I can't see that state is used anywhere... so we'll use it. If you're uncomfortable using state then create your own property... it doesn't really matter. "state" was probably going to be used for this purpose... Alpha just didn't finish what they started.

                  The key to the attached UX is giving a "value" to each top branch of the expanding menu. Then, in the onClick event for that top branch add code which sets "state" to "open".

                  The Collapse All button uses 2 Arrays... one for all the menu variables, and a matching Array for all the top branch values.

                  We process the Array and if state.state == 'open' then we close the menu and change state.state to 'closed'. If state.state is != 'open' then we set state.state to 'closed' and go on with life.

                  I think Alpha is just great for letting us do stuff like this... we can get in a get things done. It's just that so much time is wasted banging our heads against a bug infested wall all the time.

                  ux_ExpandingMenu_CollapseAll.zip
                  Last edited by Davidk; 07-29-2019, 09:10 AM.

                  Comment


                  • #10
                    Re: Collapse All Expanding Menus On A UX?

                    Nice David, good job.
                    Insanity: doing the same thing over and over again and expecting different results.
                    Albert Einstein, (attributed)
                    US (German-born) physicist (1879 - 1955)

                    Comment


                    • #11
                      Re: Collapse All Expanding Menus On A UX?

                      Yes I agree very nice, thank you David.

                      If only someone could speed up the expanding menu render when using a SQL query to populate the nodes, a couple of mine take 15 seconds or more to render

                      Comment


                      • #12
                        Re: Collapse All Expanding Menus On A UX?

                        Have you doubled checked your index settings?
                        Insanity: doing the same thing over and over again and expecting different results.
                        Albert Einstein, (attributed)
                        US (German-born) physicist (1879 - 1955)

                        Comment


                        • #13
                          Re: Collapse All Expanding Menus On A UX?

                          David K - THANK YOU! I have tried the code in your sample component and it seems to be working very well. I've left it hijacking the "state" property and will cross my fingers that the property doesn't get used some other way by Alpha. Great job, David.
                          Carol King
                          Developer of Custom Homebuilders' Solutions (CHS)
                          http://www.CHSBuilderSoftware.com

                          Comment


                          • #14
                            Re: Collapse All Expanding Menus On A UX?

                            UPDATE to code I am using from David K. Since I have 22 expanding menu components on my ux, and a possibility of more, I wondered if the Value of the top branch of each one of them really needed to be unique. To make it all less complex, I experimented with giving the same Value of 'TopBranch' to all of the top branches in all my expanding menus, and changed the code behind the Collapse All button as shown below. Since I will not be using the top branch values for anything except the code to collapse menus, this seems like it will work for me.

                            David's code behind the Collapse All button:
                            Code:
                            var expMenus = ['EXPANDINGMENU1','EXPANDINGMENU2'];
                            var expMenuValue = ['CM1','CM2'];
                            for(i=0;i<expMenus.length;i++){
                            	var menuObj = {dialog.object}.getControl(expMenus[i]);
                            	if (menuObj) {
                            	    var parent = expMenuValue[i];
                            	    if(menuObj.state.state == 'open'){
                            	    	menuObj.collapseMenu(parent);
                            	    	menuObj.state.state = 'closed';
                            	    }else{
                            	    	menuObj.state.state = 'closed';
                            	    }
                            	}
                            }
                            I have set the Value for the top branch of each of my expanding menus to TopBranch, so below is my revised code for the Collapse All button (except I have 22 expanding menus in my array for expMenus):
                            Code:
                            var expMenus = ['EXPANDINGMENU1','EXPANDINGMENU2'];
                            var parent = 'TopBranch';
                            
                            for(i=0;i<expMenus.length;i++){
                            	var menuObj = {dialog.object}.getControl(expMenus[i]);
                            	if (menuObj) {
                            	    if(menuObj.state.state == 'open'){
                            	    	menuObj.collapseMenu(parent);
                            	    	menuObj.state.state = 'closed';
                            	    }else{
                            	    	menuObj.state.state = 'closed';
                            	    }
                            	}
                            }
                            And I will just put David's code for the OnClick event of the top branch of his first expanding menu in case someone wants it, too. Be sure to give the top branch of each expanding menu a value that can be referenced in the code for the Collapse All button shown above.
                            SEE UPDATE IN COMMENTS FARTHER DOWN ABOUT THIS!!!!
                            Code:
                            //debugger;
                            var menuObj = {dialog.object}.getControl('EXPANDINGMENU1');
                            if (menuObj) {
                               	menuObj.state.state='open';
                            }
                            Last edited by kingcarol; 07-29-2019, 09:26 AM.
                            Carol King
                            Developer of Custom Homebuilders' Solutions (CHS)
                            http://www.CHSBuilderSoftware.com

                            Comment


                            • #15
                              Re: Collapse All Expanding Menus On A UX?

                              Well done, good team effort. Thanks for following up.
                              Insanity: doing the same thing over and over again and expecting different results.
                              Albert Einstein, (attributed)
                              US (German-born) physicist (1879 - 1955)

                              Comment

                              Working...
                              X