Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:07:10+00:00 2026-06-17T19:07:10+00:00

this seems really easy but have not been able to do it. Currently I

  • 0

this seems really easy but have not been able to do it.

Currently I have an enum:

enum LocationCodes{
  USA(3), Canada(4), Carribean(5), USPacific(6)
  NANPCodeGroup(int value) {this.value = value}
  private final int value
  public int value() {return value}
}

And I have a jquery grid in my gsp that has a dropdown for searching

        <!-- table tag will hold our grid -->
        <table id="customer_list" class="scroll jqTable" cellpadding="0" cellspacing="0"></table>
        <!-- pager will hold our paginator -->
        <div id="customer_list_pager" class="scroll" style="text-align:center;"></div>

<script type="text/javascript">
        /* when the page has finished loading.. execute the follow */
        $(document).ready(function () {
            jQuery("#customer_list").jqGrid({
              url:'jq_customer_list',
              datatype: "json",
              colNames:['customer','location','id'],
              colModel:[
                {name:'customer'},
                {name:'location',stype:'select', searchoptions:{value:':All;USA:USA;Canada:Canada;Carribean:Carribean;USPacific:USPacific;'}},
                {name:'id', hidden:true}
              ],
              rowNum:2,
              rowList:[1,2,3,4],
              pager: jQuery('#customer_list_pager'),
              viewrecords: true,
              gridview: true
            });
            $("#customer_list").jqGrid('filterToolbar',{autosearch:true});
        });
        </script>

For the location I would like to put in the enum values. Any thoughts? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:07:11+00:00Added an answer on June 17, 2026 at 7:07 pm

    This should give the list of enums separated by ‘;’

    ${LocationCodes?.values()?.collect{it.toString() + ':' + it.toString()}?.join(';')}
    

    So you can try something like this:

    searchoptions: {
        value: ":All;${LocationCodes?.values()?.collect{it.toString() + ':' + it.toString()}?.join(';')}" 
    }
    

    Double check the escaping of quotes, but it should work. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like it should be really easy but I've been having trouble with
This seems like it should be really easy but I couln't find an answer
this seems to be weird but it really happened. I have this code working
This is probably really easy but I can't seem to figure out how to
This seems really easy (I've done it a million times and never had a
This really seems like a bug to me, but perhaps some databinding gurus can
Ok, so this seems like a really silly problem but I can't get my
This seems like it should be really simple, but I'm unable to figure this
This seems really simple, but I can't get the syntax correct w/ the following
I know this type of question has been asked a lot, but I really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.