0

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

我怎么做?

4

1 回答 1

0
<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 + "\" />";
            }
        }
    });
于 2016-04-06T13:16:29.353 回答