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 Control with Static Data - Dashboard Counter

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

    List Control with Static Data - Dashboard Counter

    Trying to figure out the best way to go about getting a Dashboard-like counter on a list with static data..

    Essentially what I have is 2 lists..

    First list with static data:

    MenuName|Image|Action
    Filter 1|cssIcon=fa fa-bars|Filter 1
    Filter 2|cssIcon=fa fa-clock-o|Filter 2
    Filter 3|cssIcon=fa fa-star|Filter 3

    Second list data bound.

    First list filters second list. What I am looking to do is have a counter on the first list of new entries in the second list (say where status is pending review)

    So Filter 1 (2 items pending review)
    Filter 2 (5 items pending review)

    etc..

    Anyone accomplished something similar to this? If so, what direction did you go in?

    #2
    Re: List Control with Static Data - Dashboard Counter

    When you click on the list you can get Filter 1 put this into a hidden input field and then use the on change event to filter list 2.

    var pending = {dialog.Object}.listGetValue(UXListName, UXControlName [,rowNumber])

    then use the setvalue method to set the value in the input field that will then fire the onchange event and filter list 2



    List messageboard.png


    Michael

    Comment


      #3
      Re: List Control with Static Data - Dashboard Counter

      Michael,


      Thank you for your response, however this is not quite what I am looking to do..

      I attached an illustration of what I am trying to accomplish.

      illustration.jpg *Edited

      Assuming that I have a bit value for each record, we'll call it b_Rev (been reviewed).

      b_Rev goes to false after being reviewed (in this case, when the onClick event is fired).

      If b_Rev = true then do not show in counter, else show in counter.. Hope this makes more sense. I am not trying to get the record count of the list.


      Think of this as similar to email.. When you have a new email, it shows Inbox (1) right? When you open the email - the email has been reviewed and no longer shows the counter. This is exactly what I am trying to accomplish.. Just had to figure out what analogy to use hah
      Last edited by txsiccness; 04-27-2016, 10:48 AM.

      Comment


        #4
        Re: List Control with Static Data - Dashboard Counter

        I believe Riley wants a count of items pending per Filter type WHEN the page is rendered. This will give his users an idea of how many items there are for the criteria in Filter 1, 2, and 3 so that when selecting Filter 1, users will know there will be 2 items to review.

        You could do this client-side or server-side. Server-side would involve changing your Static Filter List to a data bound list. The List would be based on a View which returned your Filter Types and the count of pending items (coming from 2nd List's table).

        Client-side, upon Render you could go through the data for the 2nd List building a count for each filter type. The Static List would have a column type of Freeform layout where you'd add a div or span with an id comprised of the Logical Row # and maybe the filter type.

        Once you have the data count from the 2nd List, you'd set the innerHTML of your Static List rows.

        You'd end up with something like this...

        ListCnt1.PNG

        From a layout like this...

        Code:
        <div style="display: table; width: 100%;">
        	<div style="display: table-cell; vertical-align: middle;">
        		<div class="{dialog.style}ListItemLabelMain" style="display: inline-block; width: 40px;">{Image}</div>
        	</div>
        	<div style="display: table-cell; vertical-align: middle;">
        		<div class="{dialog.style}ListItemLabelSub" style="display: inline-block; text-align: left;">{MenuName}</div>
        	</div>
        	<div style="display: table-cell; vertical-align: middle;">
        		<div id="filter{<LogicalRowNumber>}"class="{dialog.style}ListItemLabelSub" style="display: inline-block; text-align: left;">filter count</div>
        	</div>
        	
        	<div style="display: table-cell; width: 40px; text-align: right; vertical-align: middle;">
        		<img src="{images.dialog.listNav}" />
        	</div>
        </div>

        Comment


          #5
          Re: List Control with Static Data - Dashboard Counter

          David,

          This is exactly what I am looking for. I am trying to accomplish this on the client side.

          When you say "go through the data for the 2nd List building a count for each filter type".. I'm assuming I need to loop through the list's array to find which rows have a false value for b_Rev (been reviewed) in order to get the count, how would one do so without actually selecting rows in the list? If I were actually selecting data, I would know what direction to go in.

          Thanks for your help.

          Comment


            #6
            Re: List Control with Static Data - Dashboard Counter

            You'd use the UX method .getControl() to get a pointer to your List. Once you have that object, you have access to ._data which is an Array of Objects. Each Object in the Array is a row in the List. Each Object has properties representing each column of data in that row.

            You'd loop through the _data Array examining each Object and building your counts.

            Comment


              #7
              Re: List Control with Static Data - Dashboard Counter

              Got it, thanks again David :D!

              Comment


                #8
                Re: List Control with Static Data - Dashboard Counter

                I must say that I would approach this David's way. However if you want to do it clientside then think about templating instead of the first list.


                So when the "Second" list is rendered go through it and count "in progress" and "Completed" now with these two variables you can build an unordered list with templating.

                Here I go through a list control and put markers on the map. The reason I choose this method was it allows me to build the map marker URL in JavaScript.
                you could follow a similar loop and get the count you want.


                // go through the list
                var lc = {dialog.object}.getListClientSideSummaryValue('Customers','CRM_Add_Id','count');

                // loop through the list
                for (i = 0; i < lc; i++) {

                var comp = {dialog.Object}.listGetValue('Customers','Company_Name',i );
                var id = {dialog.Object}.listGetValue('Customers','Company_Id', i);
                var phone = {dialog.Object}.listGetValue('Customers','Company_Phone', i);
                var email = {dialog.Object}.listGetValue('Customers','Company_Email', i);
                var lat = {dialog.Object}.listGetValue('Customers','CRM_ADD_Lat', i);
                var long = {dialog.Object}.listGetValue('Customers','CRM_ADD_Lng', i);
                var m1Obj = {dialog.object}.getControl('trip_Map');
                var mview = "";
                var data1 = comp;

                var name = 'marker' + id;
                var main = 'https://chart.googleapis.com/chart?'
                var middle = 'chst=d_map_pin_icon&'
                var end = 'chld=home|FFFF00'
                //alert(lat + " , " + long + " - " + data1 );
                var url1 = main + middle + end ;
                if(i == 0){

                url1 = 'https://chart.googleapis.com/chart?chst=d_map_xpin_icon&chld=pin_star%7Chome%7C00FFFF%7CFF0000';

                }
                var settings = {
                group: 'mg1', // group that the marker is part of - an arbitrary name
                icon: {
                url: url1, // url of the image to use for the marker
                width: false, // width of the image
                height: false, // height of the image
                anchor: {x: false, y: false} // anchor point of the image (this is the point in the image that will be the lat/lng of the marker)
                },
                title: data1, // mouse over help text
                detail: {
                has: true, // whether or not the marker has a "detail". The "detail" is a popup that provides the user with more information when they click on the marker.
                data: data1 // the data to display to the user
                },
                overlay: {
                has: false, // whether or not the marker has an "overlay". The "overlay" is a circle drawn on the map under the marker.
                value: '1mi', // the value to use for the size of the "overlay". This can be a string with the suffix "m", "km", "mi", or "ft" for radius, and "sq m", "sq km", "sq mi", "sq ft" for area.
                fill: {
                color: '', // color for the fill
                opacity: 1 // opacity of the fill - 0 is transparent and 1 is opaque.
                },
                stroke: {
                color: '', // color for the stroke
                width: 1, // width of the stroke (in pixels)
                opacity: 1 // opacity of the stroke - 0 is transparent and 1 is opaque.
                }
                },
                draggable: false, // specify if the user can drag the marker on the map
                animation: false, // specify the animation for the marker - values can be: false, 'drop', and 'bounce'
                emphasize: false, // number of milliseconds to emphasize (bounce) the marker on creation


                //The 'data' object is passed into all events. You can get the lat/lng of the event location from this object. For example
                //var lat = data.latLng.lat();
                //var lng = data.latLnd.lng();


                };



                m1Obj.addMarker(name,[lat,long],settings);

                }

                m1Obj.viewMarkerGroups('mg1');

                Comment


                  #9
                  Re: List Control with Static Data - Dashboard Counter

                  Just a note to show David to the rescue again.

                  Here is some templating David helped with.


                  http://www.alphasoftware.com/alphafo...915#post706915

                  Comment


                    #10
                    Re: List Control with Static Data - Dashboard Counter

                    Michael,

                    Alternative solutions are always a great contribution to the community - thank you for sharing.

                    My client actually changed his mind and just wanted a total record count of the items listed for each filter, LOL.. So I got out of having to do this, however I did get working the way David suggested.. and working well I might add.

                    Thanks you two.

                    Cheers.

                    Comment


                      #11
                      Re: List Control with Static Data - Dashboard Counter

                      Yes and David solution is the one I would use from choice.

                      Comment

                      Working...
                      X