Trying to embed multiple grids (or at least 2 of them) on a single page 
using load statements as per the following controller, functions and views.
It seems to work fine until you click view or edit, from the called grid, 
on the calling grid (step2).
The related edit and view seem to be rendered ok, but the back button is 
rendered as a link to the called grid (step3).

e.g. Step1

<https://lh5.googleusercontent.com/-HYv2KUeb-3o/UR3RYcFqHrI/AAAAAAAAAH8/m3O5HU833B0/s1600/step1.png>

Step2

<https://lh6.googleusercontent.com/-V_QGU4Cxh3w/UR3Rlu_WaJI/AAAAAAAAAIE/131_nspxuPU/s1600/step2.png>

Step3

<https://lh5.googleusercontent.com/-yfPvXYWe4X0/UR3RzE_HS5I/AAAAAAAAAIM/gU8PpH2U270/s1600/step3.png>


i.e.

Controller:
    def populate():
       db.dogs.truncate()
        db.fleas.truncate()
        db.dogs.insert(dog_name='dagwood')
        db.dogs.insert(dog_name='daisy')
        db.fleas.insert(dog_name='daisy', flea_name='fatso')
        db.fleas.insert(dog_name='dagwood', flea_name='felix')
        db.fleas.insert(dog_name='dagwood', flea_name='fatso')
        
    def dogsfleas():
        return locals()
          
    def dogs():
        db.dogs.dog_name.represent = lambda value,row: A(value, _href=URL(
"fleas",vars=dict(dog_name=row.dog_name)), cid="fleas")
        grid = SQLFORM.grid(db.dogs, csv=False)
        return dict(form=grid)
    
    def fleas():
        db.fleas.dog_name.default = request.vars.dog_name
        q = db(db.fleas.dog_name == request.vars.dog_name)
        q1 = (db.fleas.dog_name == request.vars.dog_name)
        if q.count() == 0:
            grid1 = SQLFORM.grid(db.fleas, csv=False)
        else:
            grid1 = SQLFORM.grid(q1, user_signature=False, csv=False)
        return dict(form1=grid1)
Views:
    dogsfleas.html
        {{extend 'layout.html'}}
        <div class="row-fluid">
            {{=LOAD('dogs','dogs',ajax=True, cid='dogs')}}
            <div class="span12" id='voyages'>
                  {{#=response.toolbar()}}
            </div>
        </div>     
        <div class="row-fluid">     
          <div class="span12" id='fleas'>
          </div>
        </div>
    
    dogs.html
        <h4>Dogs</h4>
        {{=form}}
        {{#=response.toolbar()}}
    
    fleas.html
        <h4>Fleas</h4>
        {{=form1}}
        {{E=response.toolbar()}}

Inspecting the dog edit code, top line buttons
    <div class="form_header row_buttons  ...
        <a class="w2p_trap button btn" href=
"/lconfirm/dogs/fleas?dog_name=daisy"><span class="icon leftar ........
        <a class="w2p_trap button btn" 
href="/lconfirm/dogs/dogs/view/dogs/2?_signature=9f67a154b0 ..........

Any work arounds/ code changes/ advice for this?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to