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

New List Control Checkbox Selector

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

    #16
    Re: New List Control Checkbox Selector

    Get the rows with the <listObject>.getCheckedRows().

    You could then send them to an XBasic function which updates your table.

    If your List has a detail view you could get the rows... and then use the .updateTableRow() method to change the value... and then sync the List.

    Remember that only 2 out of the 8 List Checkbox functions work... the others have bugs. Alpha won't fix them, but you can fix the bugs yourself... see post #4 for the fix.

    Also note that if your List is not inside a PanelCard, the List will shift 1 pixel to the right when you select for the first time. It's a really nice function... but it's a mess and badly in need of fixing and testing.
    Last edited by Davidk; August 06, 2019, 04:58 PM.

    Comment


      #17
      Re: New List Control Checkbox Selector

      Yep. Got the fix. Thanks for that. I'm able to check all the rows.

      Would this be it? It doesn't work. I have a Detail view on the list.

      Code:
      var listObj = {dialog.object}.getControl('ORDERITEMS');
      
      var chkValues = lObj.getCheckedValues();
      var pr = 1.49;
      
      listObj.updateTableRow(chkValues,{PRICE: pr});
      Last edited by dfricke10; August 06, 2019, 06:00 PM.

      Comment


        #18
        Re: New List Control Checkbox Selector

        You must loop through the checked rows... more like this...

        Code:
        var lObj = {dialog.object}.getControl('ORDERITEMS');
        var chkValues = lObj.getCheckedValues();
        var data = {};
        data.PRICE = 1.49;
        
        for(i=0;i<chkValues.length;i++){
        	lObj.updateTableRow(chkValues[i],data);
        }

        Comment


          #19
          Re: New List Control Checkbox Selector

          Works great! Thanks. Now, to make my calculations. Currently I have this in a button which allows me to change the price, quantity, or discount. It then recalculates the total and updates the selected row with the new computed value. So, the calculation to make the new TOTAL has to happen on each row. We know the price, which would be the 1.49, and now need to pull the Discount and Quantity and then calculate the new TOTAL and insert it. I'm thinking this is easier than I think.

          Code:
          var lObj = {dialog.object}.getControl('ORDERITEMS');
          
          
          if(lObj.selection[0] != 'undefined') { 
          	lObj._selectedRow = lObj.selection[0];
          }
          
          lObj.updateListFromUXControls();
          var indx = lObj._selectedRow;
          var getTotals = lObj.getData(indx).TOTAL;
          var getSubTotals = lObj.getData(indx).SUBTOTALS;
          var getQty = lObj.getData(indx).QUANTITY;
          var getPrice = lObj.getData(indx).PRICE;
          var getDisc = lObj.getData(indx).DISCOUNT;
          var getSubTotal = (getQty * getPrice) - (((getQty * getPrice) * getDisc) / 100);
          
          lObj.updateRow(indx,{TOTAL: getSubTotal});

          Comment


            #20
            Re: New List Control Checkbox Selector

            Ok. Almost there. I'm just having an issue pulling the value from the list. The 'var getQty = lObj.getData()QUANTITY;' lines are not working. The result is NaN.
            If I change the getSubTotal calculation to all numbers, it works. Variables, doesn't work.

            Code:
            function bulkUpdateRows() {
            
            var lObj = {dialog.object}.getControl('ORDERITEMS');
            var chkValues = lObj.getCheckedValues();
            
            var getQty = lObj.getData().QUANTITY;
            var getTotals = lObj.getData().TOTAL;
            var getSubTotals = lObj.getData().SUBTOTALS;
            var getPrice = lObj.getData().PRICE;
            var getDisc = lObj.getData().DISCOUNT;
            var getSubTotal = (getQty * 1.49) - (((getQty * 1.49) * getDisc) / 100);
            
            var data = {};
            data.PRICE = 1.49;
            var data2 = {};
            data2.TOTAL = getSubTotal;
            
            for(i=0;i<chkValues.length;i++){
            	lObj.updateTableRow(chkValues[i],data);
            }
            
            for(i=0;i<chkValues.length;i++){
            	lObj.updateTableRow(chkValues[i],data2);
            }
            
            
            }

            Comment


              #21
              Re: New List Control Checkbox Selector

              There are a few problems here...

              .getData() requires a key or row.
              You're running 2 loops... where you only need one. Your data object can handle more than one data field. e.g.
              data.Price = 1.49;
              data.Total = getSubTotal;

              You want to move all your data collection (getData) and calcs inside the loop... otherwise you have no idea which row you're getting the data from.
              .getData() wants a row... and you have your rows in your chkValues array.

              Everything you get from the List is a string. Because you want to use that data in a calc, get it and then convert it to a number using parseInt and parseFloat... then use it in a calc.

              Comment


                #22
                Re: New List Control Checkbox Selector

                Got it. On the .getData() part, is mine working and all I need to do is the parseInt? Or do I need to figure out a key or row?

                Comment


                  #23
                  Re: New List Control Checkbox Selector

                  David, for the life of me I cannot figure out how to pull the values from the row. I understand when you say that the data collection has to be inside the loop, but not sure where to put it.

                  Comment


                    #24
                    Re: New List Control Checkbox Selector

                    Got it!

                    Code:
                    function bulkPercentUpdateRows() {
                    
                    	var pAmount = {dialog.object}.getValue('BulkAmount1');
                    
                    	var lObj = {dialog.object}.getControl('ORDERITEMS');
                    	var chkValues = lObj.getCheckedValues();
                    	var data = {};
                    
                    for(i=0;i<chkValues.length;i++){
                    
                    	var getQty = lObj.getData(chkValues[i]).QUANTITY;
                    	var getTotals = lObj.getData(chkValues[i]).TOTAL;
                    	var getPrice = lObj.getData(chkValues[i]).PRICE;
                    	var getDisc = lObj.getData(chkValues[i]).DISCOUNT;
                    	var getSubTotal = (getQty * getPrice) - (((getQty * getPrice) * pAmount) / 100);
                    
                    	data.TOTAL = getSubTotal;
                    	data.DISCOUNT = pAmount;	
                    
                    	lObj.updateTableRow(chkValues[i],data);
                    	
                    	}
                    
                    }

                    Comment


                      #25
                      Re: New List Control Checkbox Selector

                      I would like to display a count of the number of rows in the list that have been checked. I do know how to get the count, but I am looking for an event that I can use to update the count visually on the screen.
                      The code to count the rows is:
                      var lObj = {dialog.object}.getControl('LIST1');
                      var _d = lObj._data;
                      var countCheckedBoxes = 0;
                      for (i=0;i<_d.length;i++){
                      if (_d[i]['__selected'] == true){
                      countCheckedBoxes = countCheckedBoxes + 1;
                      }
                      }
                      $('checkedRecords').innerHTML = countCheckedBoxes;
                      Ideally, it would be something like "onRowChecked" or "onRowUnchecked".
                      Is there any event that you know of like that?
                      Right now, I tie this javascript to the OnRowSelect of the list, but that is hardly elegant.

                      Thanks,
                      Jay
                      Jay Talbott
                      Lexington, KY

                      Comment


                        #26
                        Re: New List Control Checkbox Selector

                        Each time you check or uncheck a row the List event onItemDraw fires for each row. When a row is checked you get a property named __selected with a value of true. The only time this property exists is when a row is checked. This __selected property is in data which is available in onItemDraw.

                        Because onItemDraw fires for every List row after you check or uncheck a row then you can count the rows checked by looking for __selected. If it's there, count it. You'd need to set up a global variable when the UX is rendered to hold the count and then update that variable for each row data containing __selected.

                        Comment


                          #27
                          Re: New List Control Checkbox Selector

                          Is there an OnRowSelect event? Where is that? If there is I could see a problem using it because you don't necessarily select a row when checking or unchecking a row.

                          Comment


                            #28
                            Re: New List Control Checkbox Selector

                            Penge,
                            I said that wrong, it is not OnRowSelect, it is onClick.
                            You are right on both counts, onItemDraw is the correct place to put the code, and onClick is NOT ideal, as you suspected.
                            Thanks,
                            Jay
                            Jay Talbott
                            Lexington, KY

                            Comment


                              #29
                              Re: New List Control Checkbox Selector

                              In the new release, they added an onRowCheck list event. Has anyone used that or another list event to show/hide a container outside the list once a row is checked?

                              Comment


                                #30
                                Re: New List Control Checkbox Selector

                                It depends a bit on the type of container you have... and how you want to show/hide it.

                                I'd probably use the {dialog.Object}.setControlDisplay() method since you probably want to test the row your're checking/unchecking and then use .setControlDisplay to show/hide.

                                Comment

                                Working...
                                X