miércoles, 10 de septiembre de 2014

Primer template y mvvm juntos MVVM


http://stackoverflow.com/questions/21840672/how-do-i-make-a-edit-button-in-a-template-for-a-grid-in-kendoui
<%--http://jsbin.com/sanusuzutiho/1/edit--%>
<%@ Page Title="" Language="C#" MasterPageFile="~/Layout.Master" AutoEventWireup="true"
    CodeBehind="operadores.aspx.cs" Inherits="SCPServicio.admin.operadores" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SidebarContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div id="app">
        <div data-role="grid"
             data-bind="source: dataSource"
             data-scrollable="true"       
             data-sortable="true"  <%--permitir ordenacion--%>              
             data-resizable="true"           
             data-columns="[{ field: 'name' },  { field: 'age' }]">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptsContent" runat="server">
    <script id="rowTemplate" type="text/x-kendo-template">
        <tr>
            <td><span data-bind="text: name"></span></td>
            <td><span data-bind="text: age"></span></td>           
        </tr>
    </script>     
    <script>
        var items = [
            { name: 'Ded', age: 29 },
            { name: 'Red', age: 31 }, 
            { name: 'Ned', age: 100 },
            { name: 'Ted', age: 101 }
        ];

        var viewModel = new kendo.observable({
            dataSource: new kendo.data.DataSource({
                data: items
            })
        });

        kendo.bind($("#app"), viewModel);
    </script>
</asp:Content>

No hay comentarios:

Publicar un comentario