[CLOSED] GridPanel, SelectedRow and RowSelectionModel : Is JsonReader required to get selected row in server code?

  1. #1

    [CLOSED] GridPanel, SelectedRow and RowSelectionModel : Is JsonReader required to get selected row in server code?

    I have previously used the following code to get the selected row on the server side:

    RowSelectionModel sm = GridPanel2.SelectionModel.Primary as RowSelectionModel;
                if (sm.SelectedRow != null)
                      // do something
    In that case the store for GridPanel2 uses a JsonReader. If I use the same code, but instead of a JsonReader for the Store I use an ArrayReader, it wont work:

              <ext:Store ID="Store1" runat="server">
                                                <Reader >
                                                    <ext:ArrayReader IDProperty="Nbr">
                                                            <ext:RecordField Name="Nbr"></ext:RecordField>
                                                            <ext:RecordField Name="Stuff"></ext:RecordField>
    I just want to confirm that I cannot use the server side code as specified aboive if I do not use a JsonReader for the Store?

    Is there any way of getting the selected row in a GridPanel when using an ArrayReader?
    Last edited by Daniil; Apr 09, 2011 at 1:55 PM. Reason: [CLOSED]
  2. #2
    No, JsonReader is not required as I see it. I realize that I have an ArrayReader for another GridPanel, and I can select a row and in teh server code get the correct row.

    Problem is, I cannot get it to work on this GridPanel Im on now for some reason.

    <ext:GridPanel ID="GridPanel_solutions" runat="server" Height="150" Title="Test" >
                                            <ext:Store ID="Store_BookingResults_Solutions" runat="server" AutoDataBind="true" AutoLoad="true" OnRefreshData="TestABC">
                                                <Reader >
                                                    <ext:JsonReader IDProperty="Nbr">
                                                            <ext:RecordField Name="Nbr"></ext:RecordField>
                                                            <ext:RecordField Name="Score"></ext:RecordField>
                                        <ColumnModel ID="ColumnModel2" runat="server">
                                                <ext:Column ColumnID="Nbr" DataIndex="Nbr" Header="Nbr" Hidden="true"/>
                                                <ext:Column DataIndex="Score" Header="PoƤng" Width="60"/>
                                                    <RowSelect Handler="Ext.net.DirectMethods.SolutionSelected()" />
    code behind:

            public void SolutionSelected()
                RowSelectionModel sm = GridPanel_solutions.SelectionModel.Primary as RowSelectionModel;
                if (sm.SelectedRow != null) // sm.SelectedRow is always null
                    // do something
    What am I missing this time?
  3. #3

    Yes, selections don't deal with Store and, respectively, Reader.

    Is the rest part of this thread totally related to the following thread?
  4. #4
    yes, it is!

    It was a late night, I had several things that was messing with me so I guess I sort of double-posted. Im sorry about that.

    the Delay="1" works.

    But its odd since the Delay="1" was not needed in another GridPanel/RowClick in the same project. There it just is like this:
         <RowClick Handler="Ext.net.DirectMethods.SetCustomer();"    />
    and it works. Why is that?
  5. #5
    Well, it's odd. Is the rest part of configuration the same? I guess - no.

    Please provide a sample to reproduce where it works without Delay="1".
  6. #6

    Moving row from one gridpanel to another

    I want to move a selected row data to another grid but alwys am getting record undefined.
    Plz help me its very urgent
    Thanks in advance
  7. #7

    Please start a new forum thread.

Similar Threads

  1. Replies: 1
    Last Post: Mar 11, 2012, 4:03 AM
  2. Replies: 2
    Last Post: Oct 31, 2011, 6:31 AM
  3. Replies: 3
    Last Post: Oct 21, 2011, 5:35 AM
  4. [CLOSED] GridPanel : SelectedRow is always NULL?
    By wagger in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 06, 2011, 5:46 AM
  5. Replies: 1
    Last Post: Oct 30, 2008, 6:57 AM

Tags for this Thread

Posting Permissions