0

私は剣道 Web UI の初心者です。インライン編集グリッドを実装したい.追加/編集ボタンをクリックすると、更新ボタンのあるインラインフォームフィールドが表示され、データベースを更新できるように、すべての行とカスタマイズされた更新ボタン機能の一意の ID を取得したい.

<table id="grid11" style="table-layout: fixed; display:none;">
        <colgroup>
                <col style="width:10%">
                <col style="width:20%">
                <col style="width:20%">
                <col style="width:20%">
                <col style="width:30%">
        </colgroup>
    <thead>
        <tr>            
            <th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Qty</font></th>
            <th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Unit</font></th>
            <th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Style Number</font></th>
            <th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Description</font></th>            <th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Command</font></th>
        </tr>
       </thead> 
       <tbody>
        <tr>            
            <td>10</td>
            <td>12</td>
            <td>231234</td>
            <td>ItemDescription</td>
             <td></td>          
        </tr>
    </tbody>
</table>



<script>
    $(document).ready(function(){
        $("#grid11").kendoGrid({
            dataSource: {
                schema: {
                        model: { id: "id" },
                            fields: {
                                        id: { editable: false, nullable: true },
                                        Qty: { validation: { required: true } },
                                        Unit: { validation: { required: true } },
                                        StyleNumber: { validation: { required: true } },
                                        Description: { validation: { required: true } },
                                    }
                         },
                pageSize: 5
            },
            pageable: true,
            height: 300,
            sortable: true,
            toolbar: [{name:"create",text:"Add"}],
            editable: "inline",
            columns: [
                  {field: "Qty"},
                  {field: "Unit"},
                  {field: "StyleNumber"},
                  {field: "Description"},
                  { command: ["edit", "destroy"], title: "&nbsp;", width: "172px" }]

        });
        $("#grid11").show();
    });
</script>

私を助けてください。

ありがとう

4

2 に答える 2

0
<script>
    $(document).ready(function(){
        var len                     =   0;
        $("#grid11").kendoGrid({
            dataSource: {
                transport: {
                            read: "your_read_url",
                            update: {
                            url: "url_for_update",
                            type: "POST",
                            complete: function(result) {

                                }
                            },
                             create: {
                                url: "url_for_add",
                                type: "POST",
                                 complete: function(result) {

                                },
                            },
                            destroy: {
                            url: "url_for_delete" ,
                            type: "POST",
                            complete: function(result) {

                                },
                            }
                        },
                schema: {
                        model: { id: "id" },
                            fields: {
                                        id: { editable: false, nullable: true },
                                        Qty: { validation: { required: true } },
                                        Unit: { validation: { required: true } },
                                        StyleNumber: { validation: { required: true } },
                                        Description: { validation: { required: true } },
                                    }
                         },
                pageSize: 5
            },
            pageable: true,
            height: 300,
            sortable: true,
            toolbar: [{name:"create",text:"Add"}],
            editable: "inline",
            columns: [
                  {field: "Qty"},
                  {field: "Unit"},
                  {field: "StyleNumber"},
                  {field: "Description"},
                  { command: ["edit", "destroy"], title: "&nbsp;", width: "172px" }]

        });
        $("#grid11").show();
    });
</script>
于 2013-05-08T14:03:18.183 に答える