是否可以拖动和使用jQuery排序下降的GridView行? [英] Is it possible to drag and drop GridView rows with jQuery sortable?

查看:130
本文介绍了是否可以拖动和使用jQuery排序下降的GridView行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过以下方式来实现这一点:

I have tried to implement this in the following way:

GridView的:

GridView:

<asp:GridView ID="GridViewUnavailableDestination" runat="server" Visible="False" 
      Width="98%" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
      GridLines="None" CssClass="sortable">
      <Columns>
          <asp:TemplateField HeaderText="Name">
              <ItemTemplate>
                  <asp:Label ID="idUnavailable" runat="server" Text='<%# bind("idUnavailable") %>' Visible="false"></asp:Label>
                  <asp:Label Visible="true" runat="server" ID="unavailableLabel" Text='<%# bind("name")  %>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Type">
              <ItemTemplate>
                  <asp:Label Visible="true" runat="server" ID="unavailableTypeLabel" Text='<%# bind("type")  %>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="RT">
              <ItemTemplate>
                  <asp:Label Visible="true" runat="server" ID="unavailableRTLabel" Text='<%# bind("ringingTime")  %>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
      </Columns>
  </asp:GridView>

这是我的母版的javascript:

And this is my javascript in the MasterPage:

$(document).ready(function () {
        $(function () {
            $(".sortable tbody").sortable();
            $(".sortable tbody").disableSelection();
        });
});

但是,这是行不通的。

However, it does not work.

如何使这项工作任何想法?或者,如果可能的话呢?

Any ideas on how to make this work? Or if it is possible at all?

推荐答案

为了解决这个问题,它需要有一个看看下面的帖子:

To solve this issue, it is required to have a look at the following post:

http://www.isocra.com / 2008/02 /表拖和下拉式的jQuery-插件/

这是关于最近的jQuery插件,允许拖放表元素。因为浏览器使得它作为表这是为GridView的有用的。然而,这可能不足以得到解决问题的方法,因为它已经通过此信息,它与GridView的具体工作已经清楚地描述:

It is about a recent jQuery plugin that allows to Drag and Drop table elements. This is useful for GridViews since the browser renders it as a table. However, this might not be enough to get the solution to the problem, as it has been clearly described by this post, which works with GridViews specifically:

http://forums.asp.net/t/1684346.aspx/1?tableDnD+onDragClass+not+working+on+asp+net+GRIDVIEW

希望这有助于人同样的问题!

Hope this helps people with the same issue!

这篇关于是否可以拖动和使用jQuery排序下降的GridView行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆