Have a rephrased/ simplified controller, and while almost got it working,
running out of ideas/ talent.
The problem is in posting parameters to the controller and passing a value
back to the edited field (its just not seeing them).
Any ideas would be welcome, but failing that, would anyone be interested in
taking it on as a paid job to get it working?
Controller
def style(v,s1):
if v==0: s1="background-color:#CFECEC"
elif v==2: s1="background-color:#FFFFEA"
else: s1="background-color:#FFFF00"
s1=s1+"; text-align:center"
return s1
def update():
if request.args:
loc = request.args[0].split['.']
id = loc[0]
column = loc[1]
value = request.args[1]
db(db.Stats.id==id).update(column=value)
return value
def measure():
s1 = []
db.Measure.FP.represent = lambda value, row: DIV(value, _class="EDit",
_style=style(value,s1), _id=str(row.id)+'.FP')
table = SQLFORM.grid(db.Measure)
return dict(form=table, paginate=3)
View
{{response.files.append(URL('static','js/jquery.jeditable.js'))}}
{{extend 'layout.html'}}
<script>
jQuery(document).ready(function(){
jQuery('.EDit').editable("{{=URL('update')}}",{
id: 'elementid',
name: 'value',
tooltip: "Click to edit...",
submit : 'OK',
indicator : 'static\images\indicator.gif',
});})
</script>
{{=form}}
TIA,