Alright now I see a little better what is going. Last night I wasn't
able to check what the jqgrid_editable_plugin really was. To my
surprise it is a very nice web2py plugin. My appologise for pushing
the jqgrid_plugin from web2py/plugins. Although a nice plugin this is
a very feature rich ready plugin.
Anyways, I slightly revised the plugin so that this will work for you.
I will mail it to your private mail.
Once you have replaced the new plugin files you should be able to use
it by implementing the following code.
## controller
def index():
return
dict(jqgrid_table=plugin_editable_jqgrid(db.test,grid_name='grid_test',db_name='db',grid_load=URL(r=request,c='default',f='form'),target='my_form')))
def form():
id = request.args[0]
form=FORM(TABLE(TR("Your
name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
TR("Your
email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
TR("Admin",INPUT(_type="checkbox",_name="admin")),
TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) ),
TR("Profile",TEXTAREA(_name="profile",value="write
something here")),
TR("",INPUT(_type="submit",_value="SUBMIT"))))
if form.accepts(request.vars,session):
response.flash="form accepted"
elif form.errors:
response.flash="form is invalid"
else:
response.flash="please fill the form"
return dict(form=form,vars=form.vars)
## view
{{extend 'layout.html'}}
<h1>This is the default/test.html template</h1>
{{=jqgrid_table}}
{{=LOAD('default','details',args=1,ajax=True,target='my_form')}}
// Notice the two extra options (grid_load='URL(...)',target='id') in
the controller default/index.
grid_load = url to the form controller function
target = This should match the LOAD(target='id')
Hope this works for you.. :)
On May 21, 1:43 am, Jason Lotz <
jayl...@gmail.com> wrote:
> Can you explain a liitle more? You are actually seeing two forms in
> the browser?
>
> If I understand you correctly upon first loading the page you get the
> grid and a form with default id. When you select a row in the grid the
> default form is not reloaded with the new id but a second form
> appears. You see a grid and two forms. Is that right?
>
> Double check your id's. It could be that adding the extra jQuery
> ("#grid_id").jqGrid({ onSelectRow: .... }) in the view is conflicting
> with a function in the plugin. I would try making a quick test using
> the web2py jqgrid_plugin (which is a very nicely integrated plugin )
> and see if you get the same issue. If not then it is a conflict with
> your plugin script.
>
> It's passing 1:45am here so I will take a look at this editable_plugin
> tomorrow morning and see if I can find something, if you haven't
> solved it by then.
>
> ...
>
> read more »