2015-10-18 67 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 + "\" />"; 
      } 
     } 
    });