在JQuery数据表上使用cloumnFilter的问题

时间:2014-05-31 21:58:26

标签: jquery datatables jquery-datatables

我正在尝试实现jquery datatables插件columnFilter (http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html)。 使用type="text"type="date-range"时工作正常。当使用type="select"而没有指定函数中断的值时。如果我指定值它工作正常。 我的价值观是文字。

这是我的HTML:

<table id="dataTable50-2">      
    <thead>
        <tr>
            <th>#</th>
            <th>@Resources.LeadType</th>
            <th>@Resources.Provider</th>
            <th>@Resources.Campaigns_CampaignName</th>
            <th>@Resources.FirstName</th>
            <th>@Resources.LastName</th>
            <th>@Resources.Phone</th>
            <th>@Resources.Email</th>
            <th>@Resources.InsertionDate</th>
            <th>@Resources.InsertionTime</th>
            @if (ViewBag.Department != null)
            {
                <th>@Resources.LeadAttachedToUser</th>
            }
        </tr>
    </thead>
    <tfoot>
        <tr>
            <th></th>
            <th>@Resources.LeadType</th>
            <th>@Resources.Provider</th>
            <th id="campaignCol">@Resources.Campaigns_CampaignName</th>
            <th>@Resources.FirstName</th>
            <th>@Resources.LastName</th>
            <th>@Resources.Phone</th>
            <th>@Resources.Email</th>
            <th>@Resources.InsertionDate</th>
            <th></th>
            <th></th>
        </tr>
    </tfoot>
    <tbody>
        @foreach (var lead in Model)
        {
            counter++;
            <tr>
                <td></td>
                <td>@lead.LeadType.TypeDescription</td>
                <td>@lead.Campaign.Provider.ProviderName</td>
                <td>@lead.Campaign.CampaignName</td>
                <td>@lead.FirstName</td>
                <td>@lead.LastName</td>
                <td>@lead.MobilePhone</td>
                <td>@lead.Email</td>
                <td>@(((DateTime)lead.InsertionDateTime).ToShortDateString())</td>
                <td>@(((DateTime)lead.InsertionDateTime).ToShortTimeString())</td>
                @if (ViewBag.Department != null)
                {
                    <td>
                        @Html.DropDownListFor(modelItem => lead.User.UserID, new SelectList(ViewBag.Users, "Value", "Text"), Resources.ChooseRepresentative, new { @class = "lead_User_UserID" })
                    </td>
                }
            </tr>
        }
    </tbody>
</table>

这是JS:

$(document).ready(function () {
    $('#dataTable50-2').dataTable({
        aaSorting: [],
        "iDisplayLength": 50,
        bJQueryUI: true
    })
    .columnFilter({
        aoColumns: [
            null,
            { type: "text"},
            { type: "text"},
            { type: "text" },
            { type: "text"},
            { type: "text"},
            { type: "text"},
            { type: "select"},
            { type: "date-range" },
            null,
            null
        ]
    });
});

任何人都可以想到为什么我没有让选择工作?

谢谢!

0 个答案:

没有答案