Note that there are some explanatory texts on larger screens.

plurals
  1. POJQGrid data in Struts action class and JQuery dialog box
    primarykey
    data
    text
    <p>I am new to struts2 JQuery grid .. I am using JQuery grid to in that I am generating links .. Custom formatter - here is my code </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-transitional.dtd"&gt; &lt;%@ page contentType="text/html; charset=UTF-8"%&gt; &lt;%@taglib prefix="s" uri="/struts-tags" %&gt; &lt;%@taglib prefix="sj" uri="/struts-jquery-tags" %&gt; &lt;%@taglib prefix="sjg" uri="/struts-jquery-grid-tags" %&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;sj:head jqueryui="true" jquerytheme="redmond" /&gt; &lt;title&gt;gridTest&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" media="screen" href="/plugins/snap/jquery.jqGrid- 4.3.1/css/ui.jqgrid.css" /&gt; &lt;script type="text/javascript"&gt; function formatLink(cellvalue, options, rowObject) { //$("#employees_details").dialog('open'); //openDialog(employee); return "&lt;a href='ajaxActionFromJS' &gt;" +cellvalue+ "&lt;/a&gt;"; } function openDialog() { $("#employees_details").dialog('open'); } &lt;/script&gt; &lt;body&gt; &lt;s:url var="remoteurl" action="jsontable"/&gt; &lt;s:url var="empurl" action="employees-detail" /&gt; &lt;sjg:grid id="gridtable" caption="Customer Examples" dataType="json" href="%{remoteurl}" pager="true" gridModel="gridModel" rownumbers="true" width="400" height="400" altRows="true" draggable="true" editinline="true" &gt; &lt;sjg:gridColumn name="name" index="Name" title="Name" sortable="false"/&gt; &lt;sjg:gridColumn name="check" index="check" title="Check" sortable="false" formatter="checkbox" editable="true" formatoptions="{disabled:'false'}" edittype="checkbox" value="name" timeout="100" /&gt; &lt;sjg:gridColumn name="rollno" index="rollno" title="rollno" sortable="false" editable="true" edittype="text" formatter="integer" /&gt; &lt;sjg:gridColumn name="name" index="name" title="Employee" align="center" value="rollno" formatter="formatLink" /&gt; &lt;/sjg:grid&gt; &lt;s:if test="dailog"&gt; &lt;s:url var="dailog" action='ajaxAction1234' /&gt; &lt;sj:dialog id="employees_details" title="Employee Details" closeOnEscape="true" modal="true" width="400" &gt; &lt;sjg:grid id="boxTable" caption="I am Dialog Box" dataType="json" href="ajaxAction1234" pager="true" gridModel="dailogList" rownumbers="true" width="400" height="400" altRows="true" draggable="true" editinline="true" &gt; &lt;sjg:gridColumn name="name" index="Name" title="Name" sortable="false"/&gt; &lt;sjg:gridColumn name="check" index="check" title="Check" sortable="false" formatter="checkbox" editable="true" edittype="checkbox" timeout="100" /&gt; &lt;sjg:gridColumn name="rollno" index="rollno" title="rollno" sortable="false" editable="true" edittype="text" formatter="integer" /&gt; &lt;/sjg:grid&gt; &lt;/sj:dialog&gt; &lt;/s:if&gt; &lt;s:submit action="getJSONAction" value="submit" &gt;&lt;/s:submit&gt; &lt;/s:form&gt; &lt;/body&gt; </code></pre> <p>My doubt are I need to send a <code>RollNo</code> to the action class to Display a grid in dialog box. </p> <p>When user clicks on the link, the action goes to the <code>someAction</code> and gets the data from DB and shows as a JQGrid format in a Dialog box .. I can Manage to open a <code>dailog</code> box But don't know how to send that <code>RollNo</code> to action class and how to map that in Action class. </p> <p>And the <code>dailog</code> will be set to true when user click on the link .. If any further clarification please let me know.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload