首页 新闻 搜索 专区 学院

coolit 中window控件值传递问题 ?? 急急 !!

0
[已关闭问题] 关闭于 2010-10-13 17:47


   最近在项目种使用到COOLITE 0.8的控件,我将WINDOW做成一个用户空间,单击页面中的button按钮弹出window用户控件,在用户控件中使用了gridpanel,现在我要把在gridpanel中选中行的数据传递给原始页面的文本框,但这个值一弄了和久都没法传过去,有哪位大侠知道的指点一下小弟。小弟将不胜感激!

以下是用户控件的代码 (需要传递的值是仓库名称和仓库编号)
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StorageControl.ascx.cs"
    Inherits="CustomControl_StorageControl" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
              
<ext:Window ID="Window1" runat="server" Width="800" Height="540" Title="仓库列表" BodyStyle="padding:0px 6px 6px 6px;">
    <Body>
        <ext:FitLayout ID="FitLayout1" runat="server">
            <ext:Panel ID="pnlStorage" runat="server" FormGroup="true" AutoHeight="true" ButtonAlign="Center"
                Height="0">
                <Body>
                    <ext:FormLayout runat="server" ID="floStorage" LabelWidth="55">
                        <ext:Anchor>
                            <ext:MultiField ID="mtfStorage" runat="server" FieldLabel="仓库名称">
                                <Fields>
                                    <ext:TextField ID="txtfStorage" runat="server" FieldLabel="仓库名称">
                                    </ext:TextField>
                                </Fields>
                                <Fields>
                                    <ext:Button ID="btnSelect" runat="server" Text="开始查询">
                                        <AjaxEvents>
                                            <Click OnEvent="btnSelect_Click"></Click>
                                        </AjaxEvents>
                                    </ext:Button>
                                </Fields>
                            </ext:MultiField>
                        </ext:Anchor>
                        <ext:Anchor>
                            <ext:GridPanel ID="gpnStorage" runat="server" StoreID="stoStorage" StripeRows="true"
                                Height="420">
                                <ColumnModel ID="ColumnModel" runat="server">
                                    <Columns>
                                        <ext:CommandColumn Header="操作" Width="60">
                                            <Commands>
                                                <ext:GridCommand CommandName="Select" Text="选择">
                                                </ext:GridCommand>
                                            </Commands>
                                        </ext:CommandColumn>
                                        <ext:Column Header="仓库编号" DataIndex="StorageNum">
                                        </ext:Column>
                                        <ext:Column Header="仓库名称" DataIndex="StorageName">
                                        </ext:Column>
                                        <ext:Column Header="省份" DataIndex="Pronice">
                                        </ext:Column>
                                        <ext:Column Header="地市" DataIndex="City">
                                        </ext:Column>
                                        <ext:Column Header="地址" DataIndex="Adress">
                                        </ext:Column>
                                        <ext:Column Header="管理员" DataIndex="Admin">
                                        </ext:Column>
                                        <ext:Column Header="备注" DataIndex="Remark">
                                        </ext:Column>
                                    </Columns>
                                </ColumnModel>
                                <Listeners>
                                    <Command Handler="Coolite.AjaxMethods.gpnStorage_Command(command,record.data.NO);" />
                                </Listeners>
                                <LoadMask ShowMask="true" />
                                <BottomBar>
                                    <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="stoStorage" />
                                </BottomBar>
                            </ext:GridPanel>
                        </ext:Anchor>
                    </ext:FormLayout>
                </Body>
                <Buttons>
                    <ext:Button ID="btnCancel" runat="server" Text="取消" AutoShow="true">
                    </ext:Button>
                </Buttons>
            </ext:Panel>
        </ext:FitLayout>
        <ext:Store ID="stoStorage" runat="server">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="Operate" Type="Auto">
                        </ext:RecordField>
                        <ext:RecordField Name="StorageNum" Type="String">
                        </ext:RecordField>
                        <ext:RecordField Name="StorageName" Type="String">
                        </ext:RecordField>
                        <ext:RecordField Name="Pronice" Type="String">
                        </ext:RecordField>
                        <ext:RecordField Name="City" Type="String">
                        </ext:RecordField>
                        <ext:RecordField Name="Adress" Type="String">
                        </ext:RecordField>
                        <ext:RecordField Name="Admin" Type="String">
                        </ext:RecordField>
                        <ext:RecordField Name="Remark" Type="String">
                        </ext:RecordField>
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    </Body>
</ext:Window>

另外还有个问题就是这么把MultiField中的控件居右。

 

问题补充: 问题已经解决了 在column列中加上这一句 <ext:Column Header="仓库编号" DataIndex="StorageNumber"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="false" /> </ext:Column> 在gridpanel中添加以下代码用于将值传递到后台 <AjaxEvents> <Command OnEvent="SelectCommand_Click"> <ExtraParams> <ext:Parameter Name="StorageNumber" Value="record.data.StorageNumber" Mode="Raw"></ext:Parameter> <ext:Parameter Name="StorageName" Value="record.data.StorageName" Mode="Raw"></ext:Parameter> </ExtraParams> </Command> </AjaxEvents> 后台通过以下语句获得代码 string StorageNumber = e.ExtraParams["StorageNumber"]; string StorageName = e.ExtraParams["StorageName"]; 然后通过委托将值传递到原始页面
飘半空的主页 飘半空 | 菜鸟二级 | 园豆:217
提问于:2010-10-11 21:43
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册