gigaZhang / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

The search with dataUrl does not work. #1053

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(This is for feature requests and bugs in Struts2 jQuery Plugin - for
getting help, please use the User Group.
http://groups.google.com/group/struts2-jquery )

What steps will reproduce the problem?
1. Set a gridColumn with search="true", searchType="select" and searchOptions 
with a dataUrl.

Example:

<s:url id="selecturl" action="acampamento-list" />
...
<sjg:gridColumn
    name="acampamento.descricao"
    index="acampamento"
    title="Temporada"
    sortable="true"

    editable="true"         
    edittype="select"
    editrules="{ edithidden : true } "          
    editoptions="{ dataUrl : '%{selectacampamentolisturl}', style:'width:400px' }"
    formoptions="{label:'Temporada'}"

    surl="%{selectacampamentolisturl}"

    search="true"           
    searchtype="select"
    searchoptions="{ sopt: ['eq','ne'], dataUrl: '%{selecturl}' }"

    width="230" 
/>

2. In the grid, select a search button;
3. Try to select field "Temporada" in option search;

What is the expected output? 
A select with the options in a search dialog.

What do you see instead?
A text input. 

Which struts2 version?
2.3.15.3

Which struts2-jquery plugin version?
3.6.1

Please provide any additional information below.
When i removed the dataUrl from searchOptions, the select is showed, obviously 
without items. The same code works fine in jquery 3.5.1 version.

Original issue reported on code.google.com by sergio...@gmail.com on 21 Oct 2013 at 12:21

GoogleCodeExporter commented 9 years ago
We are having the same problem but could not get the code to work even under 
3.5.1 where we need customized search options:

<s:url id="selectYesNoUrl" action="select-yesno" />
<sjg:gridColumn 
  name="disabledFlag" 
  title="%{getText('label.deleted')}"
  hidden="true" 
  search="true"  
  searchoptions="{ searchhidden: true, sopt: ['eq'], dataUrl : '%{selectYesNoUrl}' }"   
  searchtype="select" 
  surl="%{selectYesNoUrl}"
/>

We get the following error in the javascript console:
Uncaught TypeError: Cannot read property 'postData' of undefined 

The struts2-jquery-grid 3.5.1 uses jqGrid 4.4.2 and per jqGrid's change log, 
there were some changes in 4.4.5 regarding "Fix in dataUrl for select".  
Despite these fixes, using 3.6.1 that includes jqGrid 4.5.2, there appears to 
continue to be problems.

Can this please be addressed?

Original comment by cranc...@gmail.com on 4 Nov 2013 at 9:28

GoogleCodeExporter commented 9 years ago
Can you please try latest version 3.7.0 first?

Original comment by johgep on 10 Apr 2014 at 7:11