jqGrid - TableToGrid
Newbie here. I have a html table (structured as required by the tableToGrid method). This table is not static but dynamically created on the server side and returned to the client as html content.
Following are my questions:
1] In the markup page, I have this: table id="list" which is ins开发者_Python百科ide a jquery dialog which pops up when some event is invoked on my web page. This dialog will contain the jqGrid which receives the html table from server side code based upon user event.
Please confirm if this table markup is required because the dynamic html content generated can have this line included.
2] To get the dynamicallly generated html content, i'm doing the below in javascript:
tableToGrid("#list", { url: myFileLocation, //this is my server side page that creates the html mtype: 'POST', postData: { param1: parva1, param2: paraval2},
viewrecords:true }Nothing seems to happen with this. I doubt that the server side page isn't reached.
The wiki document says tableToGrid converts existing html table to grid. So, does this mean, a dynamically created html table cannot be shown as grid?
Grateful if someone can clarify.
Many thanks, Ds
It could be that you try to load the server side page from a distant server, which is not allowed by the browser. you should run the script from the same server that create the table.
you may want to first load the data with $.ajax or $.post, make sure that the data is loaded correctly, and then try again.
精彩评论