title: Performing action a button click event, button being placed inside dojox.grid.DataGrid.
body: <p>I have a <code>dojox.grid.DataGrid</code>. In this a set of values are being displayed along with last 2 columns being filled up with <code>buttons</code> which are created dynamically according to data being retrieved from database using <code>formatter</code> property in <code>gridStruture</code>. Now i am getting the my grid fine. Buttons are also coming up fine. What i need to do now is when i click on a particular button on that button click event i redirect it to a new URL with a particular value(A) being passes as a query string parameter in that URL. And i don't want my page to be refreshed. Its like when a button is clicked it performs action on some other JSP page and displays message <code>alert("Action is being performed")</code>. </p>
  
  <p>My java script code where i have coded for my data grid :: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function getInfoFromServer(){
          $.get("http://localhost:8080/2_8_2012/jsp/GetJson.jsp?random=" + new Date().getTime(), function (result) {
          success:postToPage(result),
          alert('Load was performed.');
              },"json");
      }
  
  
      function postToPage(data){
      alert(data);    
      var storedata = {
          identifier:"ActID",
          items: data
          };
      alert(storedata);
  
      var store1 = new dojo.data.ItemFileWriteStore({data: storedata}) ;
      var gridStructure =[[
  
                            { field: "ActID",
                                  name: "Activity ID",
  
                                  classes:"firstName"
                            },
                            {
                                field: "Assigned To",
                                name: "Assigned To",
  
                                classes: "firstName"
                            },
                            { field: "Activity Type",
                                  name: "Activity Type",
  
                                  classes:"firstName"
                            },
                            {
                                field: "Status",
                                name: "Status",
  
                                classes: "firstName"
                            },
                            {
                                field: "Assigned Date",
                                name: "Assigned Date",
  
                                classes: "firstName"
                            },
                            {
                                field: "Assigned Time",
                                name: "Assigned Time",
  
                                classes: "firstName"
                            },
                            {
                                field: "Email",
                                name: "Send Mail",
                                formatter: sendmail,
                                classes: "firstName"
  
                            },
                            {
                                field: "ActID",
                                name: "Delete",
                                formatter: deleteact,
                                  classes: "firstName"
                            }
  
                      ]
                ];
      //var grid = dijit.byId("gridDiv");
      //grid.setStore(store1);
  
      var grid = new dojox.grid.DataGrid({
  
          store: store1,
          structure: gridStructure,
          rowSelector: '30px',
          selectionMode: "single",
          autoHeight:true,
          columnReordering:true
  
          },'gridDiv');
  
      grid.startup();
      dojo.connect(grid, "onRowClick", grid, function(){
                  var items = grid.selection.getSelected();
                  dojo.forEach(items, function(item){
                      var v = grid.store.getValue(item, "ActID");
                      getdetailsfordialog(v);
  
                      function showDialog() {
                          dojo.require('dijit.Tooltip');
                          dijit.byId("terms").show();
                      }
  
                      showDialog();
                      }, grid);
  
              });
  }
  
  function sendmail(item) {
      alert(item);
        return "&lt;button onclick=http://localhost:8080/2_8_2012/jsp/SendMailReminder.jsp?Send Mail="+item+"'\"&gt;Send Mail&lt;/button&gt;";
  
      }
  function deleteact(item) {
      alert(item);
        return "&lt;button onclick=http://localhost:8080/2_8_2012/jsp/DeleteActivity.jsp?Activity ID="+item+"'\"&gt;Delete&lt;/button&gt;";
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I am getting grid data using <code>$.get</code> call. In the above code field <code>Email</code> and <code>ActID</code> are actually buttons being created when each time function <code>sendmail</code> and <code>deleteact</code> are being called up in <code>formatter</code>. Grid is displayed. Also the value of <code>alert(item)</code> in both functions are coming up right that is there respective values. Like for <code>alert(item)</code> in <code>Delete</code> i am getting <code>ActID</code> and <code>alert(item)</code> in <code>sendmail</code> getting <code>"shan@gmail.com"</code> Now i want that on a particular <code>button click</code>(button in <code>Sendmail</code> column) my page</p>
  
  <pre><code>http://localhost:8080/2_8_2012/jsp/SendMailReminder.jsp?Send Mail="+item+"'
  </code></pre>
  
  <p>and <code>button click</code> in <code>Delete</code> column this page</p>
  
  <pre><code>http://localhost:8080/2_8_2012/jsp/DeleteActivity.jsp?Activity ID="+item+"'\"
  </code></pre>
  
  <p>opens up with value of items being retrieved from database. I have applied a <code>rowClick</code> event also which is also causing problem as when i click u button my <code>Rowclick</code> event fires instead of button click event.  How to do this. I thought of applying click event to each button on grid. But there ID i don't know. Please help me on this one. Thanks.. </p>