2016-12-02 78 views
0

需要幫助。Kendo ui grid - 複選框,特定單元格上的模式或單選按鈕

Kendo ui Grid

劍道電網代碼:

$('#triggerParameterData').kendoGrid({ 
    columns: [{field: "name"},{field: "value"},{field: "description"}], 

    selectable: "multiple,row", 
    pageable: false, 

    scrollable: false, 
    editable: true, 
    dataSource: { 
     data: popup, schema: { 
      model: { 
       fields: { 
        name: { editable: false }, 
        description: { editable: false }, 

       } 
      } 
     } 
    }, 
}) 

我想使第二排值單元格成一個複選框。如果有人有解決方案,請分享。 特別感謝。

+0

圖像附着在描述 「劍道UI網格」。 –

回答

0

參考:Kendo Grid Columns.Template

..... 
columns: [ 

    {field: "name"}, 
    {field: "value", template: '<input type="checkbox" value="#: value #">'}, 
    {field: "description"} 

] 
...... 
+0

感謝回覆哥們,但希望複選框只在一個單元格中 –

0

使用此fiddle

JS:

var popup = [ { value:true, name: "Enos", description: "Es" }, 
         { value:true,name: "Ray", description: "Rs" }, 
         { value:true,name: "Justice", description: "Js" }, 
         { value:true,name: "RR", description: "ESW" }, 
         { value:true,name: "Gop", description: "Gp" }, 
         { value:true,name: "DS", description: "JN" }, 
         { value:true,name: "Raven", description: "Rv" }, 
         { value:true,name: "FD", description: "FDGH" }, 
         { value:true,name: "Andrew", description: "Ar" }, 
         { value:true,name: "DDD", description: "GFG" }, 
         { value:true,name: "Shayne", description: "S" }, 
         { value:true,name: "YYY", description: "GHFGH" }, 
         { value:true,name: "Walter", description: "W" }, 
         { value:true,name: "EEE", description: "LUIO" }, 
         { value:true,name: "ZKZG", description: "RD" }, 
         { value:true,name: "JJJ", description: "FGJHGH" }]; 

     $(document).ready(function() { 
      $('#triggerParameterData').kendoGrid({ 
       columns: [{ field: "name" }, 
          { field: "value", template: '<input type="checkbox" value="#: value #">' }, 
          { field: "description" }], 

       selectable: "multiple,row", 
       pageable: false, 

       scrollable: false, 
       editable: true, 
       dataSource: { 
        data: popup, schema: { 
         model: { 
          fields: { 
           name: { editable: false }, 
           value: { editable: false }, 
           description: { editable: false }, 

          } 
         } 
        } 
       }, 
      }) 

     }); 
+0

感謝您的回覆哥們,但只希望複選框在一個單元格中 –

+0

您需要更新此例中的html。使用此[小提琴](https://jsfiddle.net/pandeyvishal1986/Lsr5gmk7/2/#&togetherjs=wPQi23N29L) – RonyLoud

+0

謝謝你vispan :) –