2015-10-18 63 views
0

如何在我的BootGrid中添加可编辑文本框与列的文本,以便在它打开文本框进行编辑,如果我改变它移动到下一行或丢失文本框的焦点将导致保存到数据库?bootgrid与可编辑文本框

我该怎么做?

+0

bump !!!请任何人吗? – pashute

+0

您必须使用bootgrid格式化程序来添加表格中的文本框,并且您应该创建一个脚本来执行您的保存机制以便失去焦点。 :) – vinodh

+0

你可以把这个作为一个简单的例子的答案?谢谢 – pashute

回答

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 + "\" />"; 
      } 
     } 
    });