Get url in modal window in JqGrid onclick

I am using JqGrid to display data. i need to display a modal window with html from another page when a user double-clicks a row (or alternatively...clicks a link in the grid). I also need to pass the id to the new page.

Thanks
griffawAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mydropzCommented:
what id do you need to send to the other url the rowId?
ProculopsisCommented:

The following is based on the jqGrid demo with Double-Click enabled on the row and a modal dialog displaying row information:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <title>http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_26700524.html</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <base href="http://www.trirand.com/blog/phpjqgrid/examples/loading_data/million_sql/" />
  <link rel="stylesheet" type="text/css" media="screen" href="http://www.trirand.com/blog/phpjqgrid/themes/redmond/jquery-ui-1.8.2.custom.css" />
  <link rel="stylesheet" type="text/css" media="screen" href="http://www.trirand.com/blog/phpjqgrid/themes/ui.jqgrid.css" />
  <link rel="stylesheet" type="text/css" media="screen" href="http://www.trirand.com/blog/phpjqgrid/themes/ui.multiselect.css" />
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text">
        html, body {
        margin: 0;			/* Remove body margin/padding */
    	padding: 0;
        overflow: hidden;	/* Remove scroll bars on browser window */
        font-size: 75%;
        }
  </style>
  <!-- script src="http://www.trirand.com/blog/phpjqgrid/js/jquery.js" type="text/javascript"></script -->
  <script src="http://www.trirand.com/blog/phpjqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
	<script type="text/javascript">
	$.jgrid.no_legacy_api = true;
	$.jgrid.useJSON = true;
	</script>
  <script src="http://www.trirand.com/blog/phpjqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
  <script src="http://www.trirand.com/blog/phpjqgrid/js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
<script type='text/javascript'>
jQuery(document).ready(function($) {
$("#dialog").dialog( { modal:true, autoOpen: false } );
jQuery('#grid').jqGrid({
  ondblClickRow: function(id) {
    $("#row-id").text( $(this).find("tr[id="+id+"] td").eq(0).text() );
    $("#customer").text( $(this).find("tr[id="+id+"] td").eq(2).text() );
    $("#dialog").dialog( "open" );
  },
"width":"650","hoverrows":false,"viewrecords":true,"jsonReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},"xmlReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},"gridview":true,"url":"grid.php","editurl":"grid.php","cellurl":"grid.php","rowNum":100,"sortname":"OrderID","height":150,"datatype":"json","colModel":[{"name":"OrderID","index":"OrderID","editable":true,"sorttype":"int","key":true},{"name":"OrderDate","index":"OrderDate","editable":true,"sorttype":"datetime","formatter":"date","formatoptions":{"srcformat":"Y-m-d H:i:s","newformat":"m/d/Y"},"search":false},{"name":"CustomerID","index":"CustomerID","editable":true,"sorttype":"string"},{"name":"Freight","index":"Freight","editable":true,"sorttype":"numeric"},{"name":"ShipName","index":"ShipName","editable":true,"sorttype":"string"}],"postData":{"oper":"grid"},"prmNames":{"page":"page","rows":"rows","sort":"sidx","order":"sord","search":"_search","nd":"nd","id":false,"filter":"filters","searchField":"searchField","searchOper":"searchOper","searchString":"searchString","oper":"oper","query":"grid","addoper":"add","editoper":"edit","deloper":"del","excel":"excel","subgrid":"subgrid","totalrows":"totalrows","autocomplete":"autocmpl"},"pager":"#pager"});jQuery('#grid').jqGrid('filterToolbar',{"stringResult":true});
 });
</script>
</head>
<body style="font-size:62.5%;">
  <div>
    <table id='grid'></table>
    <div id='pager'></div>
  </div>
  <div id="dialog" title="Double-Click">
    The selected row ID is: <span id="row-id"></span> <br />
    For customer: <span id="customer"></span> <br />
  </div>
</body>
</html>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
griffawAuthor Commented:
Proculopsis:

I should have been more clear. I need to pass the cell value of the id column to a new page...use that id to dynamically build the dialogue...

'''select x, y z, where id = (value passed from grid)"

Get the html from the remote url to Populate the modal window.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.