views:

45

answers:

1
  <%= Html.Trirand().JQGrid(Model.OrderGrid,"Grid1")%>

I need to call this using javascript?

Can anybody tell me?

<%= Html.Trirand().JQGrid(Model.OrderGrid,"Grid1")%> 

I have a Grid1 and Grid2 in my user control both are under div tag,,, I need to display one Grid based on user clicks on Row of first Grid1.. so My intention was to write

 $(doucment).ready(function() { 
     $("#table").click(function() { 
        // Here I need to display Grid2? 
        // I need to call <%= Html.Trirand().JQGrid(Model.OrderGrid,"Grid2")%> 
     }); 
 }); 
A: 

The code you posted is a server-side call, not a client-side one. Most likely, the Trirand() method emits a bunch of HTML, and possibly some Javascript, to the browser, thus creating a grid.

If you want to manipulate the grid with Javascript, you need to refer to the grid that is rendered in the browser, not to the server-side call. But you haven't given me much information about what it is exactly you want to do.

Robert Harvey
Thanks for your reply,, Exactly I am using this things sir.http://www.trirand.net/demoaspnetmvc.aspxI am calling the grid in my view page..so like that on click on row on GRID1 I need to show Grid2?using Jquery..
kumar
You might want to ask Trirand for assistance, but your final solution will be something that manipulates the final rendered grids. You won't be calling the Trirand() function from jQuery; that's not how it works.
Robert Harvey
Hmm Thanks for your advice sir.
kumar
Here is a hint: The second grid needs to be initially rendered in a hidden div (visibility: hidden). You can then use jQuery to show that div. All you need now is a way to hook up your first grid to a Javascript function.
Robert Harvey