Sorry if this is a repost - Google Groups is giving me fits....
I'm no expert, and my experience is limited to very old versions of both
web2py and jqGrid.
BUT in my setup, the grid block does a call to get data to populate the
grid.
I don't see a call in your grid block, like this snippet: (again this is
old)
jQuery("#accts").jqGrid({ <!--this is the id used to position the grid in the
html below-->
imgpath: '/{{=request.application}}/static/themes/steel/images', <!-- sets
the theme used for the grid-->
caption: 'Item Accounts', <!-- text to display in the header-->
{{if 'freeze' in request.vars:}}
url: '../griddata/list_all_accounts?freeze=true',
{{else:}}
url: '../griddata/list_all_accounts', <!-- this is an asyncronous call to
get the data for the grid-->
{{pass}}
datatype: 'xml', <!--the grid expects xml formatted data (see jqGrid docs
for the default xml document structure)-->
mtype: 'GET',
On Monday, March 25, 2013 6:51:10 PM UTC-4, Nate wrote:
>
> Nothing in the console. Firebug reports
>
> No Javascript on this pageIf <script> tags have a "type" attribute, it
> should equal "text/javascript" or "application/javascript". Also scripts
> must be parsable (syntactically correct).
>
>
> On Monday, March 25, 2013 11:15:31 PM UTC+11, Willoughby wrote:
>>
>> Do you get any errors in the console? That's the first place I usually
>> look...
>>
>> On Sunday, March 24, 2013 8:42:45 PM UTC-4, Nate wrote:
>>>
>>> Hi
>>>
>>> I have a controller sending JSON to my view. I cannot get the data into
>>> the TreeGrid. The Json is coming down correctly (I placed it manually and
>>> it works). Running this code places the JSON on the webpage. Controller and
>>> View below.
>>>
>>> Help appreciated.
>>> Regards
>>> Nate
>>>
>>> CONTROLLER
>>> @service.json
>>> def get_report():
>>> import json
>>>
>>> rows = db(db.neighbourhood.id > 0).select().as_list()
>>> concat = '{"response":['
>>> seq =1
>>> for row in rows:
>>> row['id'] = seq
>>> concat = concat + json.dumps(row)+","
>>> seq = seq+1
>>> innerrows = db(db.report.parent ==
>>> row.get('id')).select().as_list()
>>> for innerrow in innerrows:
>>> innerrow['id'] = seq
>>> concat = concat + json.dumps(innerrow) + ","
>>> seq = seq+1
>>> concat = concat.strip( ',' )
>>> concat = concat + ']},grid;'
>>> return concat
>>>
>>>
>>> VIEW
>>> {{extend 'layout.html'}}
>>> <script type="text/javascript">
>>> jQuery(document).ready(function(){
>>>
>>> jQuery.getJSON("{{=URL(r=request,f='call',args=['json','get_report'])}}",
>>> function(msg){
>>> jQuery.each(msg, function(){
>>> topicjson = this;
>>>
>>> $('#treeGrid').jqGrid({
>>> datastr: topicjson,
>>> datatype: "json",
>>> height: "auto",
>>> mType: 'GET',
>>> treeGridModel: 'adjacency',
>>> colNames: [/*"id",*/"Items","url"],
>>> colModel: [
>>> {name: "elementName", width:250, resizable: false},
>>> {name: "url",width:1,hidden:true}
>>> ],
>>> treeGrid: true,
>>> caption: "Neighbourhood",
>>> ExpandColumn: "name",
>>> ExpandColClick:true,
>>> autowidth: true
>>> });
>>> })
>>> });
>>>
>>> });
>>> </script>
>>>
>>> <div style="width:180px;">
>>> <table id="treeGrid">
>>> </table>
>>>
>>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.