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

problems disabling a button on a grid

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

    problems disabling a button on a grid

    I have a button on the row of a grid. I want to disable all the buttons except the current one (the row the user is currently on). I wrote this function to get the current row:
    Code:
    function getRow(){
    var rowNum = {grid.Object}.getSelectedRow();
    return rowNum;
    }​
    Then, in the button's property at the enable expression property, I entered this code:
    Code:
    data.rowNumber = getRow()
    It worked great upon loading, but when I moved to a different row in the grid, I thought the button on the old row would become disabled, but it remains enabled.

    What am I missing? Is it a bug, or do I misunderstand the enable property? Do I have to disable it at the onRowBlur event?
    Brad Steinfeldt

    #2
    If anyone has a minute, check to see if it does the same thing to you...

    I used northwind, so you would have to change the query to match your file location.
    Attached Files
    Brad Steinfeldt

    Comment


      #3
      Well as no one joined in, FWIW my experience of enabling buttons specific to a record row in Desk Top is that have to disable the button when the row changes.
      If the button is specific to the row data/key field/record #, then you need a way of letting it know whether it is required or not.
      If the button is a generic one, and appears when the row has focus, that is easier to handle than a button on each row.
      Then you can just show the button(s) required at the row level.
      Not sure how you have configured the form/.grid/ view. Send us a pic.
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #4
        Hey Ted,

        Thanks for the reply. It's a generic button. I just want it to show when the row has focus, no other requirements.

        What took me down this rabbit hole is a problem with the button performing calculations on the old row if I immediately select a different row's button. For example, if I'm on row.Number three, and I click on the button of row.Number two, the button performs calculations from the fields in row three (the old row). If I select the row first and then click the button, it works fine. That's why I thought my simple solution would be to disable the button until the row is selected, but that's proving to be just as complicated. If the button is still enabled after I move to another row, I have the chance that the button can be clicked, and I have my old problem again.

        Can and how do I disable the button once it loses focus? Is there a javascript command I can have run on the onBlur event? Or, do I have a way of ensuring that the button selected is
        Brad Steinfeldt

        Comment


          #5
          Can't you change the button immediately after the calculations are completed?
          As in, set it to its original state when it works.
          See our Hybrid Option here;
          https://hybridapps.example-software.com/


          Apologies to anyone I haven't managed to upset yet.
          You are held in a queue and I will get to you soon.

          Comment


            #6
            depending on how current your build is, you might need to adjust your rowNum function to return either true or false
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


              #7
              Ted,
              Changing the status immediately, makes sense, but what method is there for disabling a field or button on a grid? This method
              Code:
              buttonListObj.setDisabled(value, disable);
              is for a button on a UX, but is there something like this for a field/button on a grid? I can't find anything.

              Madtowng,
              I'm using an older build.

              Brad Steinfeldt

              Comment


                #8
                https://documentation.alphasoftware....a%20Button.xml

                That's all got.
                If it's too difficult, change the design.

                Can we see the layout of the panel/page/grid?
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #9
                  Thanks for the direction, but i don't think that will work. That is the documentation for a button on a UX. This is in a grid.
                  Here's a picture.
                  I might have to change the design or figure out another way. I don't feel like changing the whole thing, but maybe that's what I need to do. I didn't think this was going to be so difficult.
                  You do not have permission to view this gallery.
                  This gallery has 1 photos.
                  Brad Steinfeldt

                  Comment


                    #10
                    Thanks. That explains it a bit better.
                    Any reason why all the calcs are not run anyway?
                    See our Hybrid Option here;
                    https://hybridapps.example-software.com/


                    Apologies to anyone I haven't managed to upset yet.
                    You are held in a queue and I will get to you soon.

                    Comment


                      #11
                      Hang on!
                      You have a button for Deleting a record, so can you replicate the code to carry out the recalculation?
                      That is unless that doesn't work as expected either.
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment


                        #12
                        Let's hold that thought.
                        Brad, now that I see what you're working on, how manual is your payroll system (are you using paper-based cards/sheets, or something electronic)?
                        With a little background information, we can absolutely automate.
                        Just to explain, for the companies I work for, the pay-week starts on Saturday, ends the following Friday. We hold back one check, and distribute compensation
                        the Monday of a new payroll period. Way more work than I want to waste my time on week after week.
                        My payday calculator lets you click on a day, then presents payday information about that day.

                        We can easily talk more about this. Just this year, I wrote a project that takes the information downloaded from a digital time-clock, calculates the hours,
                        checks for vacation/pto hours, and other payroll adjustments (corrections from previous payroll, loans, etc..), then puts the information into a spreadsheet
                        prefilled with employee information that I then send back to our payroll company.

                        Gregg
                        https://paiza.io is a great site to test and share sql code

                        Comment


                          #13
                          Ted,
                          I post other things with the calc button besides just math. Maybe I could put all the commands in a function of the "Calculated field expression" property of the hours field. I don't think it would hurt anything to have it post each time it also calculates.
                          The button has also given me control over things while debugging. I recently moved the button commands from the button to the onFocus event of hours, so each time you move to the hours field, it will re-calculate and post. I still have a problem with disabling/enabling the hours field that I have with a button, but it is less likely that a user would click on the hours field.
                          As for the delete button, that's not a button in the picture but the built in part of the grid that give you the ability to delete several rows at a time. I don't know how to access that code for that column.

                          Brad Steinfeldt

                          Comment


                            #14
                            Gregg,

                            It is a payroll entry system, but very basic and manual entry. The employees either text us each night or manually fill in their hours on a card. We then enter the data manually before running payroll, and then enter the totals in Quickbooks. We've never had more than 10 employees, so it hasn't been that time consuming for us. As for vacation, pto, loans, etc., all that stuff is done through Quickbooks. I mostly enter it in this form first because it's linked to my jobs and customers, which gives me the ability to track the time per job and match it with my estimates.

                            Is the digital time clock something you created? Is it something on the server that the employee uses to enter? We are a small landscape company, so all our guys are out working and wouldn't have access to my server here, and I just use the developmental server and don't have/use a server license.

                            Brad Steinfeldt

                            Comment


                              #15
                              Ooh! Lanscaping!
                              Search Andy Sturgeon in the UK
                              I worked on this stuff as admin/costing/ design.
                              My web toolset doesn't include Alpha as I have a different one.
                              What you are after is interesting.
                              If your workforce can access 3g or 4g, it should be a breeze on a phone and in SQL on a server so you could grab it.

                              Sorry Gregg. ( another one off the list)

                              See our Hybrid Option here;
                              https://hybridapps.example-software.com/


                              Apologies to anyone I haven't managed to upset yet.
                              You are held in a queue and I will get to you soon.

                              Comment

                              Working...
                              X