On May 15, 6:42 pm, Jason Lotz <jayl...@gmail.com> wrote:
> Yes I got it working. Using the jqgrid_plugin, very nicely prepared by
> parroit, I added an onSelectRow event to trigger the reload of an
> iframe on the same page. The id of the selected row is posted as args
> to the url. The controller function then uses the row_id to update the
> view shown in the iframe.
>
> Same concept as the Subgrid feature show in demo by jqgrid. Instead of
> adding the details of the master grid to a subgrid I'm showing the
> details in a formatted view page located in an iframe so the details
> can be updated (as the rows are selected) without having to refresh
> the whole page.
>
> Jay
>
> On May 14, 11:26 pm, AsmanCom <d.as...@web.de> wrote:
>
>
>
> > Hi,
>
> > i am working with JQGrid plugin too.
> > Just to get your approach right.. you´ve realised a Master-Detail
> > function with the JQGrid?
> > Very nice! May i can use this too.
>
> > Is the code(for Controller, View) from your last post working, right
> > now?
> > Did you made any changes to the ##model code?
>
> > I am trying to implemented the "Subgrid"
> > feature:http://www.trirand.com/blog/jqgrid/jqgrid.html ->"New since beta
> > 3.0"
> > ->"subgrid with JSON Data"
>
> > This could be a nice feature, and also it would be cool to let the
> > grid show Images from the "upload" Field.
>
> > Dieter Asman
>
> > On 14 Mai, 11:32, Jason Lotz <jayl...@gmail.com> wrote:
>
> > > Sorry to keep replying to myself. Just wanted to let you know my
> > > progress. After stepping back and evaluating the case I managed to
> > > configure it as I wanted.
>
> > > ## View
> > > jQuery(document).ready(function(){jQuery("#%(id)s").jqGrid({
> > > onSelectRow: function(postdata){$("#myframe").attr('src',"/MyApp/
> > > default/details/"+(postdata));}
>
> > > });
>
> > > ## Controller
> > > def details():
> > > id = request.args[0]
> > > // everything else
> > > return dict()
>
> > > Jay
>
> > > On May 14, 5:58 pm, Jason Lotz <jayl...@gmail.com> wrote:
>
> > > > The first and obvious thing I see I did wrong was trying to put python
> > > > into jquery script.
>
> > > > jQuery("#%(id)s").jqGrid({ onSelectRow: function() {
> > > > $
> > > > ('#myframe').attr('src',"{{=URL(r=request,f='details',args=2)}}");}
>
> > > > But I still don't understand how I can make it dynamic src, or how to
> > > > get jquery to communicate with the server.
>
> > > > Jay
>
> > > > On May 14, 4:59 pm, Jason Lotz <jayl...@gmail.com> wrote:
>
> > > > > Now I have two containers, one includes jqgrid_plugin the other
> > > > > includesiframeto display /default/details view. Both work fine on
> > > > > the initial load of the page. Using jqgrid onSelectRow event I tried
> > > > > to add a function to update theiframepage.
>
> > > > > ## View
> > > > > <div>
> > > > > {{=plugin_jqgrid(db.test,columns=['fields'],height=200)}}
> > > > > </div>
> > > > > <div>
> > > > > <iframeid="myframe" src="{{=URL(r=request,f='details',args=2)}}"></
> > > > >iframe>
> > > > > </div>
>
> > > > > ## model
> > > > > jQuery(document).ready(function(){
> > > > > jQuery("#%(id)s").jqGrid({ onSelectRow: function() {$
> > > > > ('#myframe').attr('src',"{{=URL(r=request,f='details',args=2)}}");}
>
> > > > > });
>
> > > > > However when a row is selected theiframereturns Invalid Request.
> > > > > It's not even calling the controller, just displays Invalid Request. I
> > > > > haven't quite figured out how to get jqgrid and the server
> > > > > communicating. I've been able to show grid values using alert and get
> > > > > jquery to handle data sent from server but can't get jqgrid to trigger
> > > > > the server and the server read jqgrid.Parameters.
>
> > > > > Any suggestions as to the best way to updateiframecontents by
> > > > > selecting a row? And/Or someone kindly provide some sort of
> > > > > explanation how jquery and server communicate would be greatly
> > > > > appreciated !!..
>
> > > > > Jay