gigaZhang / struts2-jquery

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

Subgrid param name change #568

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.I would like to change the param name in the Subgrid URL from id to 
ordernumber. 

added prmNames to subgrid but I still see id in the URL.

<sjg:grid id="orderssubgridtable"  subGridUrl="%{orderdetailsurl}" 
gridModel="gridModel"
      rowNum="-1" prmNames="{id: 'ordernumber'}" footerrow="true" userDataOnFooter="true">
      <sjg:gridColumn name="productcode" key="true" title="Product Code" width="300" hidden="true" />
      <sjg:gridColumn name="productname" title="Product" width="300"/>
      <sjg:gridColumn name="quantityordered" title="Quantity" formatter="integer" align="center"/>
      <sjg:gridColumn name="priceeach" title="Price" formatter="currency" align="right"/>                   </sjg:grid>

2.
3.

What is the expected output? What do you see instead?

http://localhost:7001/SSJQ3/json-orderdetails.action?ordernumber=10104&_search=f
alse&nd=1308841106721&rows=-1&page=1&sidx=&sord=asc&_=1308841106722

Which struts2 version?
2.2.1
Which struts2-jquery plugin version?
3.0.2

Please provide any additional information below.

Original issue reported on code.google.com by mamo...@gmail.com on 23 Jun 2011 at 3:00

GoogleCodeExporter commented 9 years ago
Works fine for me if I try it out in the Showcase Grid (Editable) example.
When I set the attribute prmNames like your example "{id: 'ordernumber'}" I got 
following request when i try to edit or delete this entry.

Delete:
http://localhost:8080/struts2-jquery-showcase/edit-grid-entry.action?oper=del&or
dernumber=348

Edit:
http://localhost:8080/struts2-jquery-showcase/edit-grid-entry.action?city=Corkx&
country=France&creditLimit=0.00&name=Asian%20Treasures%2C%20Inc.&oper=edit&order
number=348

Original comment by johgep on 27 Jun 2011 at 2:37

GoogleCodeExporter commented 9 years ago
Johgep, 
I am navigating from Main grid to subgrid. I like to change the subgrid url 
paramname from id to ordernumber. 

Thanks,

Original comment by mamo...@gmail.com on 6 Jul 2011 at 2:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Johgep

I am having the same problem. I want to change the id in the subgrid to 
playername. Here is my sample.
<sjg:grid id="gridtable"    
caption="Player Examples"  loadonce="true"  dataType="json" 
href="%{remoteurl}"               pager="true" gridModel="gridModel">

 <sjg:grid id="subgrid" caption="Games played"  loadonce="true" prmNames="{id: playername'}"    dataType="json" href="%{Sub_remoteurl}"  gridModel="gridModel"                            >
 <sjg:gridColumn name="winner"  title="winner" />                       <sjg:gridColumn name="looser" index="looser" title="looser" />                      <sjg:gridColumn name="win_score" index="win_score" title="win_score" />                     <sjg:gridColumn name="looser_score" index="looser_score" title="looser_score" />
 </sjg:grid>
<sjg:gridColumn name="testCol" formatter="formatLink" title="" 
/>              <sjg:gridColumn name="name" index="name" title="Name" 
key="true"/>                <sjg:gridColumn name="email" index="email" title="Email"  key= 
"true"/>
</sjg:grid>

I have getter and setters for the playername in the action class..but it is 
always null.

Is there a way i can send more parameters..like I want to send name and email 
from the parent grid to my subgrid?

Original comment by niharika...@gmail.com on 10 Apr 2012 at 8:08