0

In my Edit Grid functionality my dropdown menu is unable to populate data and i still cannot resolve even though i was looking at this thread http://www.trirand.com/blog/?p…..-questions . So I need your help as I my new to this. Basically in my Action class

 public class CategoryAction extends ActionSupport {
private static final long serialVersionUID = 3643090482804105068L;
private List<String> category;    
public String execute() throws Exception{            
    generalDelegate util = new generalDelegate();    
    category = util.retrieveCategory();
    System.out.println("+++++++++");
    return "success";
}
public List<String> getCategory() {
    return category;
    }
   }

The category return the following result [Toothpaste, Body Bath, Shampoo, Shaver Cream, Hand Soap, Facial Wash, Hair Dressing] In my Struts.xml

<action name="jsonCategoryAction" class="general.CategoryAction"> 
        <result type="json" name="success">Category.jsp</result> 
    </action>  

while lastly my Main.jsp

                <s:url id="selectCategoryUrl" action="jsonCategoryAction" />
                                    <sjg:gridColumn 
                                        name="category1″ 
                                        index="category1″ 
                                        title="Item Category" 
                                        sortable="true"
                                        editable="true"
                                        edittype="select" 
                                        editoptions="{ dataUrl : '%{selectCategoryUrl}' }" />  

Pls guide me where did i go wrong…. Thanks a lot

1 Answers1

0

Please read the doc

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#editoptions

dataUrl

    The data is obtained via an AJAX call and should be a valid HTML
    select element with the desired options <select><option
    value='1'>One</option>…</select>. You can use option group.

So your ajax request have to return a valid html select element.

Quincy
  • 4,393
  • 3
  • 26
  • 40
  • this is not exactly the answer what i was looking for. But anyway i solved it by googling... Thanks Quincy –  Nov 03 '12 at 20:59