Show value in label on row selection

  1. #1

    Show value in label on row selection

    hiii

    I m using the GridPanel.In a grid i have two differnt Id and other details.I want to get this two id on particular row selction.and show this Id in two diffrent label.

    i m using this code:
    
    
    
    
    <ext:JsonReader ReaderID="Bookid,AuthorId">
    <Fields>
    <ext:RecordField Name="Bookid" />
    <ext:RecordField Name="FirstName" />
    <ext:RecordField Name="LastName" />
    <ext:RecordField Name="AuthorId" />
    <ext:RecordField Name="GroupName" />
    <ext:RecordField Name="Date" />
    </Fields>
    </ext:JsonReader>
    </Reader>
    <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" StripeRows="true" Title="Active Patient List" Width="800" Height="430" TrackMouseOver="true" Icon="User">
    <ColumnModel ID="ColumnModel1" runat="server">
    <Columns>
    <ext:Column Header="Bookid" Width="155" DataIndex="Bookid">
    <ext:Column Header="Full Name" Width="155" DataIndex="LastName">
    <ext:Column Header="LastName" Width="120" DataIndex="LastName" />
    <ext:Column Header="AuthorId" Width="60" DataIndex="AuthorId" Hidden="true" />
    <ext:Column Header="GroupName" Width="120" DataIndex="GroupName" />
    <ext:Column Header="Date" Width="100" DataIndex="Date" />
    </Columns>
    </ColumnModel>
    <SelectionModel>
    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
    <RowSelect OnEvent="RowSelect" Buffer="250">
    <ExtraParams>
    <ext:Parameter Name="Patientid" Value="this.getSelected().id" Mode="Raw" />
    </ExtraParams>
     <ExtraParams>
    <ext:Parameter Name="AdmissionId" Value="this.getSelected().id" Mode="Raw" />
    </ExtraParams>
    </RowSelect>
    </ext:RowSelectionModel>
    </SelectionModel>



    protected void RowSelect(object sender, AjaxEventArgs e)
    {
    string Bookid= e.ExtraParams["Bookid"];
    string AuthorId= e.ExtraParams["AuthorId"];
    TextBox1.Text = Bookid;
    TextBox2.Text = AuthorId;
    }
  2. #2

    RE: Show value in label on row selection

    Hi,

    The ReaderID can't contains two id field (only one) . Therefore the declaration*ReaderID="Bookid,AuthorId" will be ignored by parser. Set only one or doesn't set it then id value will be generate automatically.


    You can pass need values to the server as shown below


    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
    <AjaxEvents>
    ** <RowSelect OnEvent="RowSelect" Buffer="250">
    ** * *<ExtraParams>
    ** * * * <ext:Parameter Name="Bookid" Value="this.getSelected().data.Bookid" Mode="Raw" />
    ** * * * <ext:Parameter Name="AuthorId" Value="this.getSelected().data.AuthorId" Mode="Raw" />
    ** * *</ExtraParams>
    ** </RowSelect>
    </AjaxEvents>
    </ext:RowSelectionModel>





  3. #3

    RE: Show value in label on row selection

    Thanks.......
    your reply really help me......but i dont get the value in the text box.....how can i show the particular value in the text box on row selection.
    I m trying this code:]
    
    
    
    <RowSelect OnEvent="RowSelect" Buffer="250">
    <ExtraParams>
    <ext:Parameter Name="Bookid" Value="this.getSelected().data.Bookid" Mode="Raw" />
    </ExtraParams>
    <ExtraParams>
    <ext:Parameter Name="AuthorId" Value="this.getSelected().data.AuthorId" Mode="Raw" />
    </ExtraParams>
    </RowSelect>
    
    
    
    protected void RowSelect(object sender, AjaxEventArgs e)
    {
    string Bookid= e.ExtraParams["Bookid"];
    string AdmissionId = e.ExtraParams["AuthorId"];
    TextBox1.Text = Bookid;         
    TextBox2.Text = AuthorId;
    }
    I m not getting the value in text boxes.
    From: RS

  4. #4

    RE: Show value in label on row selection

    *Please ensure that in RowSelect handler the variables Bookid and AdmissionId have values.What TextBox do you used? Coolite or ASP.NET?




  5. #5

    RE: Show value in label on row selection



    I have use the Asp.net textbox. and variables Bookid and AdmissionId have values.but i m not geeting the value in text box. plse can u help how can i get....
    thaks

    from:
    RS
  6. #6

    RE: Show value in label on row selection

    Hi,

    The ASP.NET controls can't be updated during Coolite AjaxEvent. Please use Coolite TextField control


  7. #7

    RE: Show value in label on row selection

    thanks....
    when i used coolites text field then i got the value in text box....

    From:rs

Similar Threads

  1. Replies: 1
    Last Post: May 21, 2012, 3:47 PM
  2. How to show dollars format on label
    By Mr.Techno in forum 1.x Help
    Replies: 5
    Last Post: Nov 28, 2011, 8:56 AM
  3. I can't show label with textfield
    By LLdeOJ in forum 1.x Help
    Replies: 1
    Last Post: Nov 24, 2010, 10:57 AM
  4. [CLOSED] How to show a label in front of a button?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 01, 2010, 10:54 AM
  5. Replies: 3
    Last Post: Jun 18, 2009, 6:57 AM

Posting Permissions