本文介绍了回复:我有想要对列进行排序的表,但我尝试过并包括一些排序插件.它仍然会抛出一些错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


回复:我有要对列进行排序的表,但我尝试过并包括一些排序插件.它仍然会引发一些错误.
在错误控制台中.
同样,我想基于记录(行)编辑记录,并基于记录(行)删除记录.
时间戳记:2012年10月9日下午5:54:10
错误:TypeError:$(#tbDetails").tablesorter不是函数
源文件:http://localhost:50976/User.aspx
线:52

Hi,
Re:I have table i want sorting for the columns but i tried and included some sorting plugin also.still it is throwing some errors.
in error console.
for same thing i want edit the records based on record(row) and delete the records based on record(row).
Timestamp: 10/9/2012 5:54:10 PM
Error: TypeError: $("#tbDetails").tablesorter is not a function
Source File: http://localhost:50976/User.aspx
Line: 52

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="User.aspx.cs" Inherits="FiSoftCustomerPortal.User" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

    <%--<script type="text/javascript" src="Scripts/Jquery.min2.js"></script>     --%>
    <%--<script src="Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>--%>
    <script src="Scripts/jquery-latest.js" type="text/javascript"></script>
    
    <script src="Scripts/jquery.tablesorter.js" type="text/javascript"></script>
    <script src="Scripts/jquery.tablesorter.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "User.aspx/BindDatatable",
            data: "{}",
            dataType: "json",
            success: function (data) {
                //alert(data.d.length);                
                for (var i = 0; i < data.d.length; i++) {
                    $("#tbDetails").append("<tr><td>" + data.d[i].UserName + "</td><td>" + data.d[i].USerEmailID + "</td><td>" + data.d[i].Active + "</td><td>" + data.d[i].PhoneNumber + "</td></tr>");

                }                        

            },
            error: function (result) {
                alert("Error");
            }
        });
    });
//    $(function () {
//        $("#tbDetails").stupidtable();
//    });
//        $(document).ready(function () {
//           $("#tbDetails").stupidtable();        
//        });

    $(document).ready(function () {
        //$("#tbDetails").tablesorter({ widgets: ['zebra'] });
        $("#tbDetails").tablesorter();
       // $("#tbDetails").tablesorter({ selectorHeaders: '> thead > tr > td' });
    }
);

    $(document).ready(function () {
        $("#tbDetails").tablesorter({ sortList: [[0, 0], [1, 0]] });
    }
); 
    
   
</script>
<style type="text/css">
         .btn1
        {
            background: url("../images/btn_bg.gif") repeat-x scroll center top #015F92;
            border: 1px solid #015F92;
            border-radius: 3px 3px 3px 3px;
            color: #FFFFFF;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            margin: 0;
            padding: 5px 15px;
        }
        a
        {
            outline: medium none;
            text-decoration: none;
        }
        .style1
        {
            width: 100%;
        }
    </style>


  

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="full" id="main_body" align="center">
<div id="droppable">
<table class="style1">
        <tr id="Tr1" align="center"  runat="server">
            <td>
                                      
            </td>
            
            <tr><td align="left" valign="top"> <asp:Button ID="btnNew" runat="server" Text="New..." onclick="btnNew_Click" 

                                              CssClass="btn1" /> <asp:Button ID="btnEdit" 

                    runat="server" Text="Edit..." onclick="btnNew_Click" 

                                              CssClass="btn1" /> <asp:Button 

                    ID="btndelete" runat="server" Text="Delete..." onclick="btnNew_Click" 

                                              CssClass="btn1" /></td></tr>
                                              
 <tr align="center">
 <td> 
 <table class="nrmltbl" id="tbDetails" cellpadding="0" cellspacing="3" border="0" style="border: medium groove #6699FF">
<thead style="border: medium groove #9999FF; background-color:#006699; color:White; font-weight:bold">
<tr style="border: medium ridge #000000">
<td>User Name</td>
<td>User EmaiID</td>
<td>Is Active</td>
<td>Phone Number</td>
</tr>
</thead>
<tbody>
</tbody>
</table></td></tr>
            </table>
</div>
</div>




在完成以下代码之后,请输入users.aspx.cs,请检查并给我一些建议.




IN users.aspx.cs following code i done please check it and give me some suggestions.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services;
using System.Configuration;
using System.Collections;
using BusinessLayer;


namespace FiSoftCustomerPortal
{
    public partial class User : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        [WebMethod]
        public static BLUsers[] BindDatatable()
        {
            Encryption clsencrypt = new Encryption();
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            List<blusers> details = new List<blusers>();
            DataSet BindDs = new DataSet();
            BLUsers bluser1 = new BLUsers();
            BindDs = bluser1.BindtabletoUsers();
            clsencrypt.decryptDataSet(BindDs);
            dt = BindDs.Tables[0];
            foreach (DataRow dtrow in dt.Rows)
            {
                BLUsers bluser = new BLUsers();
                bluser.UserName = dtrow["User_Name"].ToString();
                bluser.USerEmailID = dtrow["User_EmailID"].ToString();
                bluser.Active = dtrow["Is_Active"].ToString();
                bluser.PhoneNumber = dtrow["Phone_Number"].ToString();
                details.Add(bluser);
            }
            return details.ToArray();


        }       

        protected void btnNew_Click(object sender, EventArgs e)
        {
            Response.Redirect("ManageUser.aspx");
        }
    }
}

推荐答案

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="User.aspx.cs" Inherits="FiSoftCustomerPortal.User" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

    <%--<script type="text/javascript" src="Scripts/Jquery.min2.js"></script>     --%>
    <%--<script src="Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>--%>
    <script src="Scripts/jquery-latest.js" type="text/javascript"></script>
    
    <script src="Scripts/jquery.tablesorter.js" type="text/javascript"></script>
    <script src="Scripts/jquery.tablesorter.min.js" type="text/javascript"></script>
<script type="text/javascript">




这篇关于回复:我有想要对列进行排序的表,但我尝试过并包括一些排序插件.它仍然会抛出一些错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 03:32