开发者

jqGrid table off of DOM

开发者 https://www.devze.com 2023-03-28 14:19 出处:网络
I am trying to get jqGrid to work off a DOM table that already exists.I am a little confused with some of the instructions to do this however...For instance, I read this on one particular help site...

I am trying to get jqGrid to work off a DOM table that already exists. I am a little confused with some of the instructions to do this however... For instance, I read this on one particular help site... http://www.secondpersonplural.ca/jqgriddocs/_2h30t8wte.htm When he says this: "the new release of jquery.jqGrid.js defaults to this module being enabled, so ensure that grid.tbltogrid.js and grid.tbltogrid-min.js are copied to the appropriate folder. If you do not wish to include this function, make the appropriate change to jquery.jqGrid.js."

What is he talking about?

Also, the Jquery grid download site gave me this set of instructions: "In order to use this module you should mark the Table to Grid (in Other modules) when you download the grid. For more information refer to Download. For Developers - this is the grid.tbltogrid.js in the src directory." Now I had the Table to Grid module marked when I downloaded.

What would I should be doing to get this done?

What function should I be calling, currently I am calling...

    (function () {
            tableToGrid(".table1", {});
    });

That seems a little bit wrong.

UPDATE: Added what I reference Here are the scripts that I reference.开发者_开发问答.. Ignore the DataTable scripts... I will soon be removing them once I can confirm that this works.

<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="~/Content/jqUIcss/jquery-ui-1.8.14.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="~/Content/jqGrid/ui.jqgrid.css" />      
<script type="text/javascript" src="<%=ResolveClientUrl("~/Scripts/jquery-1.5.1.min.js")%>"></script>        
<link href="../../Content/dataTable.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="<%=ResolveClientUrl("~/Scripts/jqUI/jquery-ui-1.8.14.custom.min.js")%>"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.metadata.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.jqGrid.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.locale-en.js")%>" type="text/javascript"></script>


Assuming you did download the components correctly and included them in your application through <script> tags, all you seem to have to do is:

tableToGrid('#table_name')

where the table name is the id of the table you're trying to convert.

Edit: Note the #, whereas you used . and what seems to be a table ID. . signifies a class name.


<script src="<%=ResolveClientUrl("~/Scripts/grid.base.js")%>" type="text/javascript">   </script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.tbltogrid.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jqDnR.js")%>" type="text/javascript"></script>

Added these scripts and things seem to be fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消