【问题标题】:bootgrid with editable textbox带有可编辑文本框的引导网格
【发布时间】:2015-10-18 21:20:12
【问题描述】:

如何在我的 BootGrid 中添加一个带有列文本的可编辑文本框,以便在其中打开文本框进行编辑,如果我将其更改为移动到下一行或失去文本框的焦点将导致保存到数据库?

我该怎么做?

【问题讨论】:

  • 顶!!!请任何人?
  • 您必须使用 bootgrid 格式化程序来添加表格内的文本框,并且您应该创建一个脚本来执行您的保存机制以失去焦点。 :)
  • 你能用一个简单的例子来回答吗?谢谢

标签: database textbox jquery-bootgrid


【解决方案1】:
<table id="grid-keep-selection" class="table table-condensed table-hover table-striped">
    <thead>
        <tr>
            <th data-column-id="order" data-type="numeric" data-identifier="true">#</th>
            <th data-column-id="selected" data-formatter="commands" data-sortable="false">Seçili</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>@i</td>
            </tr>
            i += 1;
        }
    </tbody>
</table>


    $("#grid-keep-selection").bootgrid({
        formatters: {
            "commands": function (column, row) {
                return "<input type=\"number\" class=\"form-control\" name=\"txtSoru\" id=\"txtSoru" + row + "\" value=\"0\" min=\"0\" max=\"" + row + "\" />";
            }
        }
    });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-13
    • 2015-03-28
    • 2017-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多