[置顶] Ext.Net 1.x_Ext.Net.GridPanel行选择

上图:

[置顶] Ext.Net 1.x_Ext.Net.GridPanel行选择_第1张图片

前台代码:

            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server"   />
               </SelectionModel>
                <DirectEvents>
                    <Click OnEvent="SubmitSelection">
                        <ExtraParams>
                            <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanelCourse}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
                        </ExtraParams>
                        <EventMask ShowMask="true" Msg="数据正在生成,请稍候..."  MinDelay="500"/>  
                    </Click>
                </DirectEvents>

后台代码:

    protected void SubmitSelection(object sender, DirectEventArgs e)
    {
        string json = e.ExtraParams["Values"];

        List<Xuanke> XuankeList = JSON.Deserialize<List<Xuanke>>(json);
  
        foreach (Xuanke xk in XuankeList)
        {
            id = xk.Id;
            this.txtCourse.Text = xk.Course;
            this.txtTeacher.Text = xk.Teacher;
            this.txtScheduledDate.Text = xk.ScheduledDate.ToString() ;
            if (xk.IsCompulsory == 'N')
            {
                this.cbxCompulsory.SelectedIndex = 0;
            }
            else 
            {
                this.cbxCompulsory.SelectedIndex = 1;
            }

        }
    }

你可能感兴趣的:(json,object,String,server,ext)