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

Help executing both a server-side search and sort on a list

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

    Help executing both a server-side search and sort on a list

    I have a UX with both a keyword search field and a sort dropdown box which selects the field to sort on. This is a fairly common configuration but I have not found a solution. The list is a paginated freeform list which is long, has embedded images and is mobile, so both the search and sort have to be server-side.

    Problem 1 was setting the sort to the selected column. This I solved, though probably not the best solution, by using a series of "if" statements to test for the dropdown value and then executing a sort on that field.

    Problem 2 I have not solved and that is how to execute the server-side sort without losing (or by re-applying) the search field. If the search returns 20 rows, applying a server-side sort returns all rows.

    - The "Filter Records in a List Control" action JS would be great but, though it says it is a "filter/sort" (and the video on it's use shows "order" in the debug info) I don't see the sort option. Am I just missing something here?

    - I also tried {dialog.object}._filterList which does have a sort parameter but it needs to test for "contained in" and not just "=." Is there a syntax for that which works for this method?

    Is there an easier way to accomplish this common configuration?

    #2
    Re: Help executing both a server-side search and sort on a list

    Update: I did resolve this issue, after several dead ends, with a fairly complex use of the filters in the sql builder, arguments, placeholder fields and {dialog.object}._filterList. It works great but feels quite "rigged." There still must be a simpler solution so a list can have a search part, like a grid, with sort and search executed server-side together. I'm guessing this is a technological issue with lists as the "Filter records in list control" action does not have the order control it says it has. Again, it feels like I'm just not finding it. Please, somebody confirm or deny if I am crazy.

    Would still love to hear a better solution and, if anyone wants me to post my cumbersome solution, I will.

    Comment


      #3
      Re: Help executing both a server-side search and sort on a list

      Please post your cumbersome solution.

      Ps I don't know you well enough to determine if you are crazy.
      Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

      Comment


        #4
        Re: Help executing both a server-side search and sort on a list

        Thanks for asking Frank. (haha there is an hour I won't get back. ) Here it is:

        Remember, I am trying to do three things at once: 1. Keyword search three fields, 2. Filter on a status field and 3. Order on a selected column (field since it is a freeform list).

        First, I used the sql builder to set a filter using "LIKE" and "or" to accomplish a multiple field keyword search AND apply the status filter. The bracketing of the OR statements was tricky and the rendered sql does not look like the settings in the builder but it works.

        WHERE (table.field1 LIKE :search OR table.field2 LIKE :search OR table.field3 LIKE :search) AND (table.Status LIKE :filter)

        However, since the "LIKE" function requires the format %term% I created a dummy field, hidden behind another element with a client side computed value of '%'+{search}+'%' and set the :search argument to be set at runtime to the value in the dummy field.

        For setting the field to sort on, I used this (named "sortaction"):

        var a ={dialog.object}.getValue('Sort');

        if (a=="User"){
        {dialog.object}._filterList('vidlistb4','1=1','User','');

        }
        if (a=="Popular"){

        {dialog.object}._filterList('vidlistb4','1=1','rank','');
        }
        if (a=="Recent"){

        {dialog.object}._filterList('vidlistb4','1=1','DateAdded:-1','');


        }

        Notice that the filter parameter is set to all by 1=1. The base SQL is still filtered by the value set in the dummy field as the :search argument. I used "filterList" to do the sort because I could not find another way to do a server side sort with either Action JS or a UX method.

        For the filter I also used a dummy field (filter2) and it looks something like this:

        var a ={dialog.object}.getValue('Filter');
        var b =('%'+a+'%');

        {dialog.object}.setValue('Filter2',b);
        {dialog.object}.runAction('Sortaction');

        Note: Like search, the :filter argument is set to filter2. And, by using "sortaction" for the final search it picks up all parameters (search, sort and filter). I also have the search button set to just execute "sortaction."

        You can see why I call this "rigged." I am still way open to the easier method I must have missed. I do wish I was crazy and the "Filter Records in a List Control" action JS had the sort option it says it has. I must be blind I guess.
        Last edited by ecalan; 07-16-2015, 07:14 PM.

        Comment

        Working...
        X