coolite SqlDataSource

<%@ Page Language="C#" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Coolite Toolkit - GridPanel with SqlDataSource</title>
    <link href="http://www.cnblogs.com/http://www.cnblogs.com/../resources/css/examples.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .x-grid3-td-fullName .x-grid3-cell-inner
        {
            font-family: tahoma, verdana;
            display: block;
            font-weight: normal;
            font-style: normal;
            color: #385F95;
            white-space: normal;
        }
        .x-grid3-row-body p
        {
            margin: 5px 5px 10px 5px !important;
            width: 99%;
            color: Gray;
        }
    </style>

    <script type="text/javascript">
        var fullName = function(value, metadata, record, rowIndex, colIndex, store) {
            return '<b>' + record.data.LastName + ' ' + record.data.FirstName + '</b>';
        };
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <ext:ScriptManager ID="ScriptManager1" runat="server" HideInDesign="True" />
       
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
           
            SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [Title], [TitleOfCourtesy], [BirthDate], [HireDate], [Address], [City], [Region], [PostalCode], [Country], [HomePhone], [Extension], [Notes] FROM [Employees]">
        </asp:SqlDataSource>
       
        <ext:Store ID="Store1" runat="server" DataSourceID="SqlDataSource1">
            <Reader>
                <ext:JsonReader ReaderID="EmployeeID">
                    <Fields>
                        <ext:RecordField Name="FirstName" />
                        <ext:RecordField Name="LastName" />
                        <ext:RecordField Name="Title" />
                        <ext:RecordField Name="TitleOfCourtesy" />
                        <ext:RecordField Name="BirthDate" Type="Date" />
                        <ext:RecordField Name="HireDate" Type="Date" />
                        <ext:RecordField Name="Address" />
                        <ext:RecordField Name="City" />
                        <ext:RecordField Name="Region" />
                        <ext:RecordField Name="PostalCode" />
                        <ext:RecordField Name="Country" />
                        <ext:RecordField Name="HomePhone" />
                        <ext:RecordField Name="Extension" />
                        <ext:RecordField Name="Notes" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>

        <ext:GridPanel
            ID="GridPanel1"
            runat="server"
            Title="Employees"
            Frame="true"
            Height="600"
            StoreID="Store1">
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column ColumnID="fullName" Header="Full Name" Width="150" DataIndex="LastName">
                        <Renderer Fn="fullName" />
                    </ext:Column>
                    <ext:Column DataIndex="Title" Header="Title" Width="150" />
                    <ext:Column DataIndex="TitleOfCourtesy" Header="Title Of Courtesy" Width="150" />
                    <ext:Column DataIndex="BirthDate" Header="BirthDate" Width="110">
                        <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                    </ext:Column>
                    <ext:Column DataIndex="HireDate" Header="HireDate" Width="110">
                        <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                    </ext:Column>
                    <ext:Column DataIndex="Address" Header="Address" Width="150" />
                    <ext:Column DataIndex="City" Header="City" Width="100" />
                    <ext:Column DataIndex="Region" Header="Region" Width="100" />
                    <ext:Column DataIndex="PostalCode" Header="PostalCode" Width="100" />
                    <ext:Column DataIndex="Country" Header="Country" Width="100" />
                    <ext:Column DataIndex="HomePhone" Header="HomePhone" Width="150" />
                    <ext:Column DataIndex="Extension" Header="Extension" Width="100" />
                </Columns>
            </ColumnModel>
            <View>
                <ext:GridView runat="server" EnableRowBody="true">
                    <GetRowClass Handler="rowParams.body = '<p>'+record.data.Notes+'</p>'; return 'x-grid3-row-expanded';" />
                </ext:GridView>
            </View>
            <SelectionModel>
                <ext:RowSelectionModel runat="server" />
            </SelectionModel>
        </ext:GridPanel>
    </form>
</body>
</html>

转载于:https://www.cnblogs.com/AndySong/archive/2009/11/01/1593790.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值