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

List Drag On Row : Amazing

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

    List Drag On Row : Amazing

    The new List Drag On Row feature is just excellent. I built a PGB App with the example component and the drag action is smooth and clean... exactly like a native app.

    With the List Drag Row, and the ControlBar and Disclosures, ViewBox, FormView, and Templating language... the Alpha team is erasing the line between native and hybrid apps.

    And all this crosses over into web apps as well.

    As Wallace would say... Nicely Done !

    ListDragRow.PNG

    #2
    Re: List Drag On Row : Amazing

    Have a look for Row Drag Actions here... http://aadocuments.s3.amazonaws.com/...easeNotes.Html

    Comment


      #3
      Re: List Drag On Row : Amazing

      Agreed I just saw that - nicely done builders too!
      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

      Comment


        #4
        Re: List Drag On Row : Amazing

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

        Comment


          #5
          Re: List Drag On Row : Amazing

          So far, I am getting my image in my list control to change out to grey - and mark the row as complete - in other words the drag action script appears to work, the only problem is this is a list with a detail view and it is NOT saving my edit. Not sure how to do that.
          My action code is as follows:

          Code:
          this.setValue(index,false);
          var data = this.getData(index);
          if(data.tasks_is_complete =='Yes'){
          	this.setValue(data.tasks_is_complete=='No');
          	//listObj.updateTableRow(rowNumber,{tasks_is_complete: 'No'});
          	{dialog.object}.saveListEdits('TASKS',{rows: 'current'});
          }else{
          if(data.tasks_is_complete =='No'){
          	this.setValue(data.tasks_is_complete = 'Yes');
          	//listObj.updateTableRow(rowNumber,{tasks_is_complete: 'Yes'});
          	{dialog.object}.saveListEdits('TASKS',{rows: 'current'});
          }
          this.updateRow(index,data);
          }

          Now I doubt that the "saveListEdits" is right (not throwing an error) OR "updateTableRow" but not sure what to put in its place to sync/save the row edit - I commented out "updateTableRow" because I think "this.updateRow" takes its place.
          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

          Comment


            #6
            Re: List Drag On Row : Amazing

            Oh by swapping out the image (that's a conditional image) I mean that the button for the slide is working as expected and changing the value of tasks_is_complete by using this code:

            Code:
            this.setValue(index,false);
            var data = this.getData(index);
            if(data.tasks_is_complete == 'Yes'){
            	return [{html: 'Complete', className: 'flag', action: 'setcomplete'}]; 
            } 
            if(data.tasks_is_complete == 'No'){
            	return [{html: 'Not Complete', className: 'archive', action: 'setcomplete'}]; 
            }

            so what this does is change the button and it's appearance by the value in tasks_is_complete
            very cool and simple thanks to AS.
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #7
              Re: List Drag On Row : Amazing

              This is the Action code you want.

              Code:
              var data = this.getData(index);
              switch(data.tasks_is_complete){
              	case 'Yes':
              		var updData = {};
              		updData.tasks_is_complete = 'No';
              		this.updateTableRow(index,updData);
              		//{dialog.Object}.saveListEdits('TASKS',{rows: 'allRows'});
              		break;
              	case 'No':
              		var updData = {};
              		updData.tasks_is_complete = 'Yes';
              		this.updateTableRow(index,updData);	
              		//{dialog.Object}.saveListEdits('TASKS',{rows: 'allRows'});
              		break;
              }
              I'm not sure where you are getting rowNumber from. A suggestion... use camelCase in your code... e.g. setComplete instead of setcomplete.
              .saveListEdits() is for synchronzing back to the table. Do you want to do this every time a row is swiped? I'd use a Sync button... but it depends on what's required.
              .updateRow is for non-Detail View, non-data bound Lists... so it wouldn't be used in this case.
              Use a switch statement instead of nested if statements... much easier to read.

              Comment


                #8
                Re: List Drag On Row : Amazing

                Ok, so this would be a fast way to mark a task as complete. Drag to the right and reveal the Complete or Not Complete button - selecting it or continuing the action would set the complete status to switch out and then YES syncronize - it doesn't appear to do that.

                Where I was getting row number from is in the click event for the image: currently, if you click the image it sets the complete status to yes or no (it swaps it out) then saves the value.
                My Onclick code for that is:
                Code:
                var tic = data.tasks_is_complete;
                if(tic=='No'){
                	listObj.updateTableRow(rowNumber,{tasks_is_complete: 'Yes'});
                	{dialog.object}.saveListEdits('TASKS',{rows: 'current'});
                }else{
                	listObj.updateTableRow(rowNumber,{tasks_is_complete: 'No'});
                	{dialog.object}.saveListEdits('TASKS',{rows: 'current'});
                }
                since this is a conditional image the image then swaps out accordingly to a greyed out image.
                Like I said you can observe it in action from that link i posted previously. The list I am working on is in the Technician Agenda

                The problem comes in with my current code where if you swipe it updates as expected but if you then click the image I get an error that says that "the database cannot find the data you requested" and I get a yellow triangle and a red one (error) on the row.
                Prior to the drag event the Onclick works great!


                SO to continue and make this EVEN MORE functional I want to drag to the left now creating 3 buttons with 3 different classes - so far so good and I have set alerts for each one which does indeed work swimmingly!
                I want to run some action javascript which doesn't appear to work. Obviously, syntax here is a bit different and that's what REALLY needs clarification to me.
                For instance, I have a button that I used the action javascript to open a google map through a super control definition - that works great.
                How would I do the SAME thing with my map button in the drag event?
                I just can't use the action javascript builder or a run action because I get this.blah-blah blah errors in the console that kills the whole component on load so how are we supposed to know all of the this.syntax statements? we can run/reference to make full use.

                One last thing, the color picker is pretty amazing now too, but the style builder doesn't preview the new background colors. I am sure they will get that sorted.
                Last edited by CharlesParker; 08-27-2017, 03:24 PM. Reason: spelling and grammatical errors, I hate that..
                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                Comment


                  #9
                  Re: List Drag On Row : Amazing

                  What's with the empy brackets in var updData= {};
                  ???
                  NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                  Comment


                    #10
                    Re: List Drag On Row : Amazing

                    It seems that you're trying to mix and match other stuff with the List Side-to-Side Drag Row functionality. If your "conditional image" is a template command... then ok... but I'd use the correct terminology.

                    If your conditional image is actually a conditional image with an onclick event... then I'm not sure what you're trying to do with reference to the List Side-to-Side Drag Row stuff.
                    Your image should be taken care of in the List Layout... as in the sample.

                    It seems you should start a new thread.

                    var updDate = {}; sets up a new Object... which is used for the JSON going into the .updateListTable() method.

                    Comment


                      #11
                      Re: List Drag On Row : Amazing

                      ok, I am not trying to mix and match (although, at this point, it might appear that way). What I am trying to do is REPLACE the current Onclick event of the dynamic conditional image with the drag function. I was only bringing it up to show that method and how I was getting it done and the fact that it indeed uses "javacsript" but the javascript you have to use in the drag event is different.
                      Actually, there are 4 possible values so after further thought on what I want to do I am convinced your case statement is the way to go.
                      I have it working as expected with this code:
                      Code:
                      this.setValue(index,false);
                      var data = this.getData(index);
                      switch(data.tasks_is_complete){
                      case 'Yes':
                      	var updData={};
                      	updData.tasks_is_complete ='No';
                      	this.updateTableRow(index,updData);
                      	break;
                      case 'No':
                      	var updData={};
                      	updData.tasks_is_complete ='Yes';
                      	this.updateTableRow(index,updData);
                      	break;
                      case 'Flag':
                      	var updData={};
                      	updData.tasks_is_complete ='Yes';
                      	this.updateTableRow(index,updData);
                      	break;
                      case 'Reminder':
                      	var updData={};
                      	updData.tasks_is_complete ='Yes';
                      	this.updateTableRow(index,updData);
                      	break;
                      	}
                      {dialog.object}.saveListEdits('TASKS',{rows: 'current'});
                      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                      Comment


                        #12
                        Re: List Drag On Row : Amazing

                        One caveat of note here. After I got the drag to the right working I set out to create a drag to the left with 3 buttons. One of the buttons is named FLAG and the code behind that sets the tasks_is_complete field to a value of 'Flag'
                        Here's where I accidentally introduced an error.
                        The code ran perfectly, however, if I attempted to drag it again I would get an error about property undefined cannot read 'length'. The PROBLEM was that when I setup the first drag to the right javascript I only had two conditions - tasks_is_complete could either be Yes or NO and that would determine what the button would read, set its class, etc. Since the value was now 'Flag' and neither 'Yes' nor 'No' I got an error. Once I ammended the javascript to include all possibilities the error is gone and all is well.
                        This is a REALLY cool feature that makes my app work FASTER. Now, all a user has to do is slide the row to flag a task or mark it as complete and they can easily change it back!

                        Took me awhile to figure it out. This reminds me of writing a conditional image statement and then having a condition where nothing was true...hello, error!
                        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                        Comment

                        Working...
                        X