Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Can't figure out this one

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

    Can't figure out this one

    I would like to have a show hide section on each row of a tabular grid. I want to hide certain fields unless they are needed then show them with a button click.

    Here is what I have figured out so far in the onclick event of a button.
    Code:
    var rowNum = {Grid.RowNumber}+'';
    var cObject = 'detailsDiv'+rowNum;
    //alert(cObject);
    var oDivEle = $(cObject);
    	if(oDivEle.style.display == 'block') {
        		oDivEle.style.display = 'none';
    		this.innerHTML='SHOW DETAILS';
      	}
    	else {
    		oDivEle.style.display = 'block';
    		this.innerHTML='HIDE DETAILS';
    	}
    This works ok. It shows and hides the div in the first row. The id changes to reflect the current row.

    Here is where I am stuck.

    Code:
    This code is in a freeform area of a field.
    
    <div id="detailsDiv1" style="display:none;">
    <table>
    	<tr>
    	<td>{problem}</td>
    </tr>
    	<tr>
    	<td>{action}</td>
    </tr>
    	<tr>
    	<td>{rrepairs}</td>
    </tr>
    Again this works Ok for the first row. What I need to do is dynamically change the row number to match the row of the grid for example <div id = "detailsDiv1" , <div id = "detailsDiv2" ,<div id = "detailsDiv3" , etc.

    If anyone can give me some hints I would much appreciate it. Maybe I am approaching this from the wrong angle.
    Last edited by frankbicknell; 06-28-2011, 07:16 AM.
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

    #2
    Re: Can't figure out this one

    Update, this does put the dynamic id into a js variable. How can I use that variable to set the div id in the html?

    Code:
    added in the freeform area
    
    <script type="text/javascript">
    <!--
    var rowNum = {Grid.RowNumber}+'';
    var cDivId = 'detailsDiv'+rowNum;
    //alert(cDivId);
    -->
    </script>
    This works but I can't get the fields to display instead of the text.

    Code:
    this works.
    document.write("<div id='"+cDivId+"' style='display:none'><table><tr><td>what</td></tr><tr><td>the</td></tr><tr><td>heck</td></tr></table></div>");
    
    this does not
    document.write("<div id='"+cDivId+"' style='display:none'><table><tr><td>{problem}</td></tr><tr><td>{action}</td></tr><tr><td>{rrepairs}</td></tr></table></div>");
    nor this
    document.write("<div id='"+cDivId+"' style='display:none'><table><tr><td>"+{problem}+"</td></tr><tr><td>"+{action}+"</td></tr><tr><td>"+{rrepairs}+"</td></tr></table></div>");
    Last edited by frankbicknell; 06-28-2011, 08:32 AM.
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

    Comment


      #3
      Re: Can't figure out this one

      Hey Frank,

      You won't need to do the JS thing. Use some "data" in your freeform HTML code instead. You can use your Record Id... anything unique will do. This code is using my fields, but that has no effect. Don't use a div id, I don't think you need it and I believe it sets up the fields just for the first row. I've tried using {data.<RowNumber>} and variations of it, but can't get it to behave. If you use your record id, change your button code to pick up the data you need.

      Code:
      <table id="detailsDiv{data.Member_id}" style="display:none;">
      <tr>
      	<td>{Member_id}</td>
      </tr>
      	<tr>
      	<td>{First_name}</td>
      </tr>
      	<tr>
      	<td>{Last_name}</td>
      </tr>
      </table>

      Comment


        #4
        Re: Can't figure out this one

        Thanks David, I will try this later. Now off to work.
        Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

        Comment


          #5
          Re: Can't figure out this one

          Thanks again David but I was your suggestion to work for me.
          Got this to work though. In the freeform edit region of the button. It dirties the fields when changed and enables the submit button like I wanted.

          Code:
          <script type="text/javascript">
          <!--
          var rowNum = {Grid.RowNumber}+'';
          var cDivId = 'detailsDiv'+rowNum;
          
          document.write("<div id='"+cDivId+"' style='display:none'></div>");
          
          $(cDivId).innerHTML = '<table><tr><td>{problem}</td></tr><tr><td>{action}</td></tr><tr><td>{rrepairs}</td></tr></table>';
          -->
          </script>
          Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

          Comment


            #6
            Re: Can't figure out this one

            Well as it sometimes goes in Alpha. My script worked well in all of the preview modes but not when published. I couldn't figure out why. I was able to come up with an alternative however. I am using the showhide expression in the fields which is set to show when a condition is true and hide when it is false controlled by a button. This was the simplest solution.
            Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

            Comment


              #7
              Re: Can't figure out this one

              Since I am not able to experiment with Alpha as often as I would like lately it seems like I am getting 'rusty'.

              If I am using the showhide expression in a field and the expression evaluates to false the field is not shown. Shouldn't the freeform template for that field also not be shown?

              If the showhide expression evaluates to false the field is not shown but all of the code in the freeform template is still displayed. Is this a bug or is that the way it should work?
              Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

              Comment


                #8
                Re: Can't figure out this one

                Frank,

                Is this what you want to do? Have 3 fields in a column freeform area. Changes to any of these fields must enable the submit buttons. This column will show or hide based on an expression. Attached are screen shots that might help. Two of the 3 fields I have hidden. The 3rd field is the one used for the freeform section.
                Attached Files

                Comment


                  #9
                  Re: Can't figure out this one

                  David that is very generous of you to take time to help me solve this issue.

                  Your method is the way in which I started out. However when you add labels to the hidden fields, eg. a row tag above the field, the labels show no matter what the Show/Hide expression evaluates to. It seems to me if you have the field hidden the freeform template for that field should be hidden too.

                  This is what I have settled on for now. I am using a form(columnar) grid. It is not perfect yet. I am using a dummy bit field in the Show/Hide expression which ends up causing the grid to become dirty just by clicking on the image to show the hidden fields. I hope I can figure out how to do it with a variable. Also I would like to use the freeform template with labels to make the grid look better.


                  This is the code in the onclick event of the image I use to show the details. The setValue function causes a callback that evaluates the showhide expressions and shows or hides the fields accordingly.
                  Code:
                  var lShowDetails = {grid.Object}.getValue('G','SHOWDETAILS',{Grid.RowNumber});
                  	if(lShowDetails == 1) {
                  		{grid.Object}.setValue('G','SHOWDETAILS',{Grid.RowNumber},0);
                  		this.src = 'Zoom in.png'
                    	}
                  	else {
                  		{grid.Object}.setValue('G','SHOWDETAILS',{Grid.RowNumber},1);
                  		this.src = 'Zoom out.png'
                  	}
                  This is the show/hide property in the field I am hiding
                  7-3-2011 7-43-15 AM.png

                  Here is the result.
                  7-3-2011 7-23-15 AM.png 7-3-2011 7-28-02 AM.png
                  Last edited by frankbicknell; 07-03-2011, 08:07 AM.
                  Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                  Comment


                    #10
                    Re: Can't figure out this one

                    Nice looking forms, Frank. I didn't know about the labels... now I see it.

                    Comment


                      #11
                      Re: Can't figure out this one

                      Finally figured it out. At least for my taste. I guess I over analyzed it at first. It was there in Alpha all the time. I ended up using a form type grid with accordion tabs. It makes the rows a little larger than I wanted but it works well, requires little coding, and gets the job done.

                      I can have them all closed.
                      7-10-2011 9-55-53 AM.png

                      or expanded.
                      7-10-2011 9-56-22 AM.png
                      Last edited by frankbicknell; 07-10-2011, 09:58 AM.
                      Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                      Comment

                      Working...
                      X