将自动完成搜索添加到nopcomerce

时间:2015-06-30 06:26:38

标签: c# razor nopcommerce

我是nopcommerce的新手,我试图在nopcommerce的配置页面上添加自动填充搜索框。我知道标准配置中有一个搜索框模型,但我如何实现呢?

修改:这是我的代码,我试图添加搜索框

@model Nop.Plugin.Widgets.NivoSlider.Models.ConfigurationModel
@using Nop.Web.Framework;
@using Nop.Web.Models.Catalog;
@Html.Action("StoreScopeConfiguration", "Setting", new { area = "Admin"})
@using (Html.BeginForm())
{
    <fieldset>
        <legend><strong>@T("Plugins.Widgets.NivoSlider.Picture1")</strong></legend>
        <table class="adminContent">
            <tr>
                <td class="adminTitle">
                    @Html.OverrideStoreCheckboxFor(model => model.Picture1Id_OverrideForStore, model => model.Picture1Id, Model.ActiveStoreScopeConfiguration)
                    @Html.NopLabelFor(model => model.Picture1Id):
                </td>
                <td class="adminData">
                    @Html.EditorFor(model => model.Picture1Id)
                    @Html.ValidationMessageFor(model => model.Picture1Id)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.OverrideStoreCheckboxFor(model => model.Text1_OverrideForStore, model => model.Text1, Model.ActiveStoreScopeConfiguration)
                    <div class="search-box">
                        @Html.Action("SearchBox", "Catalog")
                    </div>
                    @Html.NopLabelFor(model => model.Text1):
                </td>
                <td class="adminData">
                    @Html.EditorFor(model => model.Text1)
                    @Html.ValidationMessageFor(model => model.Text1)
                </td>
            </tr>
            <tr>

1 个答案:

答案 0 :(得分:2)

您好您可以在前端站点中添加与搜索框相同的自动完成功能。它也有自动完成。只需按标准jquery实施自动填充即可。它需要源数据,您将根据文本框中键入的单词从数据库中获取数据。