【问题标题】:Drag and Drop rows in an ASP.NET gridview using jQuery使用 jQuery 在 ASP.NET gridview 中拖放行
【发布时间】:2013-12-30 21:29:16
【问题描述】:

我无法使用 jQuery 在我的 ASP.NET gridview 中实现拖放功能。我尝试使用http://isocra.com/2008/02/table-drag-and-drop-jquery-plugin/ 提供的拖放插件,但它不适用于我的网格,我在母版页上引用所需的 js 文件,这是我在准备好的函数中使用的代码。

 $(document).ready(function(){
  $('#grdSummary').tableDnD();
 });

js和css链接如下:

   <script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <link href="Styles/tablednd.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery.tablednd.js" type="text/javascript"></script>

我浏览了文档,它说你只需要使用 tableDnD 函数来完成工作,我在这里错过了什么吗?任何帮助将不胜感激。

【问题讨论】:

    标签: jquery asp.net gridview drag-and-drop tablednd


    【解决方案1】:

    不确定,但您可以尝试如下

        $(document).ready(function(){
          $('#<%=grdSummary.ClientID%>').tableDnD();
          });
    

    希望这会有所帮助!

    【讨论】:

    • 已经试过了,没什么区别。我们可以使用 css 类,而不是使用 clientID 属性。它更容易,但这里我通过 ID 指代
    • 需要更多信息才能对此进行调查。你能张贴网格标记吗
    【解决方案2】:

    尝试为所有 TD、TR 以及网格命名。这会有所帮助。 http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多