Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7624549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:59:36+00:00 2026-05-31T04:59:36+00:00

I have a code which is working fine and displaying some set of values

  • 0

I have a code which is working fine and displaying some set of values to me in a grid which is dojox.grid.DataGrid. Now i want to perform some event like when i click on a particular row it will redirect me to a new JSP page. Or will open a window where i can do something. How to do that ? Please help me out. thanks.

The code is ::

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="MyPackage.PopulateTextbox" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
   @import "http://ajax.googleapis.com/ajax/libs/dojo/1.7/dojo/resources/dojo.css";
   @import "http://ajax.googleapis.com/ajax/libs/dojo/1.7/dijit/themes/nihilo/nihilo.css";
   @import "http://ajax.googleapis.com/ajax/libs/dojo/1.7/dojox/grid/resources/Grid.css";
   @import "http://ajax.googleapis.com/ajax/libs/dojo/1.7/dojox/grid/resources/nihiloGrid.css";

</style>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.7/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">

dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojo.data.ItemFileWriteStore");
</script>
<%
String temp1;
PopulateTextbox obj = new PopulateTextbox();
temp1 = obj.method();
request.setAttribute("variable", temp1); 
%>

<script type="text/javascript">
dojo.ready(function(){
var myVar = <%= request.getAttribute("variable") %>
var storedata={
            identifier:"ID",
            label:"name",
            items: myVar
    };

var store = new dojo.data.ItemFileWriteStore({data: storedata});

    var gridStructure =[[

                      { field: "ID",
                            name: "ID_Emp",
                            width: "40%"
                      },
                      {
                          field: "Names",
                          name: "Name",
                          width: "40%"
                      }

                ]
          ];


     var grid = new dojox.grid.DataGrid({
            id: 'grid',
            store: store,
            structure: gridStructure,
            },
          document.createElement('div'));

        /*append the new grid to the div*/
        dojo.byId("gridDiv").appendChild(grid.domNode);

        /*Call startup() to render the grid*/
        grid.startup();
});
</script>

<title>Dojo Data</title>
</head>
<body>
<div id="gridDiv" dojoType="dojox.grid.DataGrid" title="Simple Grid" style="width:1000px; height:500px;">
</div>


</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:59:37+00:00Added an answer on May 31, 2026 at 4:59 am

    In your onready function, after grid.startup, do the following:

    dojo.connect(grid, "onRowClick", grid, function(evt){
        var idx = evt.rowIndex,
            item = this.getItem(idx);
    
        //  get the ID attr of the selected row
        var value = this.store.getValue(item, "ID");
    
        //open a dialog or new window or redirect to new JSP
    
        //to redirect to new jsp, you can set window.location.href to the new url
    
        //to open a new dialog, i suggest using dijit.dialog 
        //see: http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Dialog.html
    
        //to open a new window, use window.open
        //http://www.pageresource.com/jscript/jwinopen.htm
    });
    

    more grid examples at:
    http://dojotoolkit.org/documentation/tutorials/1.6/working_grid/

    The API doc lists all the possible events:
    http://dojotoolkit.org/api/1.6/dojox/grid/DataGrid#onApplyCellEdit

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have jquery validation code which is working fine in ff but the same
Hi Javascript gurus, I have this Javascript code which is working fine on Firefox
I have several of these in my code which have been working fine so
In this case I have some code which is working without problem in an
i have got below code which is working fine: public abstract class Beverage {
I have a code to create VIEW in mysql database which is working fine
I have code which as been working against an older Active Directory server and
I have the follwing code (which is not working): private void Window_PreviewKeyDown(object sender, KeyEventArgs
I'm working on a code base in which we have several configurable types. One
I already have code which lazy loads scripts on request. My issue now is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.