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

jQuery and alpha 5

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

  • jQuery and alpha 5

    Hey There,

    We have purchased a bootstrap template that has user functionality through javascript. Such as widget minimize, show help div on icon click. It uses jquery quite a lot, as well as numerous javascript files.

    We initially didn't add any alpha components until we had finished customizing the dashboard based on the boostrap template.

    Now that we're happy with the functioning of widgets opening/closing, general look and feel of our main theme and page, we are adding the alpha components.

    We are able to add the components - easy peasy thanks to the wizard that comes with alpha.

    But the components buttons don't work in the a5w page that's based on the boostrap template.

    If we comment out the jquery include code that's within the a5w page, then the componenent buttons work, but no other javascript functionality does. Erk.

    We've tried putting all the javascript files and includes at the top (they were previously at the bottom of the page) so it's above the components codes, then add the noconflict code, then add the alpha5 code for the component. Something like this

    <script src="dashjs/custom.js"></script> <!-- Custom codes -->
    <script src="dashjs/charts.js"></script> <!-- Charts & Graphs -->
    <script type="text/javascript">
    var $j = jQuery.noConflict();
    </script>
    <%a5
    'component code thingo goes here
    %>

    This then results in the components buttons working, but the javascript functionality on the webpage (such as widget minimize) not working.

    Does anyone have any advice on what we can a) have javascript functionality and b) have alpha component button functionality.

    Thank you in advance.

  • #2
    Re: jQuery and alpha 5

    This should be in the forum for the version of Alpha that you are using.

    If you let me know which version you have, I'll move it.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    Comment


    • #3
      Re: jQuery and alpha 5

      I think now that '$' is taken over by alpha when you include alpha javascript library, that shortcut is no longer available in jquery to refer to
      document.getelementById. so you declare
      $J=jquery.noConflict();
      then in the other library wherever you used $ to refer to document.getElementById you use $J.
      thanks for reading

      gandhi

      version 11 3381 - 4096
      mysql backend
      http://www.alphawebprogramming.blogspot.com
      ggandhi344@gmail.com
      Skype:ggandhi344@gmail.com
      1 914 924 5171

      Comment


      • #4
        Re: jQuery and alpha 5

        Hi Alan, we are using V12. Thank you!

        Comment


        • #5
          Re: jQuery and alpha 5

          Thank you Gandhi for your time to reply. It was appreciated and gave us direction this morning.



          Solution Found:


          Step 1. In the included javascript files, I changed $ to jQuery

          Step 2. In the included javascript files, I also wrapped the functions with: jQuery(document).ready(function() { }

          Step 3. Then in the a5w page we set the structure of the header html to first list the included the javascript files, then below that included <script>jQuery.noConflict();</script>, then below that included the alpha component code.

          It works. Cheers.

          Comment


          • #6
            Re: jQuery and alpha 5

            I work with boostrap themes a lot... really excellent stuff. Alpha automatically puts in the noConflict code... has for quite some time... so you don't need that. I've never needed to add the document ready stuff.

            To help with changing your code from $ to jQuery Selwyn (I believe it was Selwyn) wrote an excellent function in Sept. 2014... from the release notes...

            Code:
            jQuery - Make Safe for Alpha Anywhere - a5_make_jQuery_safe() Function - Many jQuery Javascript files are written using the $ object as a proxy for the jQuery object. This makes it impossible to use these files in AlphaAnywhere without first editing the files and changing the $ object to the jQuery object. This can be a tedious process because a simple search and replace will not work as that would replace the $ string literal.
            The a5_make_jQuery_safe() function converts all references to the $ object to 'jQuery' while leaving $ in variables names and strings unchanged.
            NOTE: This function is built on top of the Node.JS GRASP module.
            Syntax:
            L flag =a5_make_jquery_safe(c filename [, flagCreateBackup = .t. ])
             
            If fileCreateBackup is .t. a file with the extension of .old is created with the original text in the file.
            And here's a little UX that helps me when I need to do this. Make sure the full path and file name are entered.
            Attached Files

            Comment


            • #7
              Re: jQuery and alpha 5

              Hi David,

              Thanks for replying. I find it very curious you say that.

              How does alpha add the noconflict code? Does it add it as code in the a5w page? Or does it add the conflict code when you insert a component? Does it set it in maybe an unknown page setting that I'm unaware of? I would love to physically see how and where alpha actually adds the noconflict code for future reference!

              How and why have you never needed the document ready stuff?!?!?! This part really confuses me! Is it that our version isn't the same as yours?

              Thank you in advance.

              Comment


              • #8
                Re: jQuery and alpha 5

                Originally posted by loustory2 View Post
                Thank you Gandhi for your time to reply. It was appreciated and gave us direction this morning.



                Solution Found:


                Step 1. In the included javascript files, I changed $ to jQuery

                Step 2. In the included javascript files, I also wrapped the functions with: jQuery(document).ready(function() { }

                Step 3. Then in the a5w page we set the structure of the header html to first list the included the javascript files, then below that included <script>jQuery.noConflict();</script>, then below that included the alpha component code.

                It works. Cheers.
                glad to hear that you got it working. very good.
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                ggandhi344@gmail.com
                Skype:ggandhi344@gmail.com
                1 914 924 5171

                Comment


                • #9
                  Re: jQuery and alpha 5

                  Originally posted by loustory2 View Post
                  Hi David,

                  Thanks for replying. I find it very curious you say that.

                  How does alpha add the noconflict code? Does it add it as code in the a5w page? Or does it add the conflict code when you insert a component? Does it set it in maybe an unknown page setting that I'm unaware of? I would love to physically see how and where alpha actually adds the noconflict code for future reference!

                  How and why have you never needed the document ready stuff?!?!?! This part really confuses me! Is it that our version isn't the same as yours?

                  Thank you in advance.
                  Alpha adds the noConfict stuff in the <head> section of an a5w page... and their line of code is a bit better than is generally used. Publish and open an a5w page which contains a component and then inspect that page... you'll see the noConfict code.

                  I haven't needed to use the document.ready stuff when integrating an Alpha component into a bootstrap theme... not that I remember. I've just checked the last 2 I recently did and I can't see, or recall, that I did. Depending on the complexity of the bootstrap theme and it's features, I suppose it may be needed. I'm using the current version of Alpha... and the pre-release versions.

                  Where did you get your bootstrap theme? There are some excellent themes out there.

                  Comment


                  • #10
                    Re: jQuery and alpha 5

                    Hey David,

                    Wow - that's really interesting. Ok, so for curiosity sake and the purpose of future reference, I did as you suggested and created a new project, a new table, new compentn and new page. Checked out the code and this is what came up:

                    <meta name="generator" content="Alpha Anywhere HTML Editor Version 12 Build 2689-4440">
                    <!-- must use in order to make XP Themes render -->
                    <meta HTTP-EQUIV="MSThemeCompatible" content="Yes" />
                    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
                    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
                    <meta name="apple-mobile-web-app-capable" content="yes" />

                    <title></title>
                    </head>
                    <body>
                    <p>&nbsp;</p> <%A5 ?x_TESTER.Output.Body.Search_HTML %>
                    <%A5 ?x_TESTER.Output.Body.Grid_HTML %>
                    <%A5 ?x_TESTER.Output.Body.DetailView_HTML %>
                    </body></html>

                    I may be missing it, but I couldn't see the noconflict code?!
                    What are your thoughts?

                    Cheers

                    Comment


                    • #11
                      Re: jQuery and alpha 5

                      Hey Lou,

                      That's the code you see when you edit your a5w page... correct? Now... publish and open it... then inspect the page... expand and look in the head section.

                      Comment


                      • #12
                        Re: jQuery and alpha 5

                        That is just a little bit too cool.

                        This is what came up:


                        <script>
                        if(typeof jQuery != 'undefined') jQuery.noConflict();
                        </script>


                        So, this leads to my next question for you David......
                        How come I needed to wrap my functions with jQuery(document).ready(function() { }.....

                        hhhmmm...I'm going to play with it a bit more.

                        Cheers

                        Comment


                        • #13
                          Re: jQuery and alpha 5

                          Sooooo....it turns out that the noconflict code isn't needed.

                          But if the jquery files aren't put up the top of the code, then it doesn't work. By default, the boostrap theme has them at the bottom.

                          I'll update more for the wrapping with jQuery(document).ready(function() { }..... in a couple of days when my schedule lets me play with those files again.

                          Thanks David. That's been great.

                          Comment

                          Working...
                          X