[CLOSED] GridPanel One-to-many V2.5 with Single rowSelectionModel and Extra Parameter

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] GridPanel One-to-many V2.5 with Single rowSelectionModel and Extra Parameter

    I am updating a VisualStudio project and moving from Coolite to Ext.Net 2.5. My model works in the old version but will not update the details grid in the new version.

    I am using the GridPanel one-to-many example with a sqldatasource. I have data in both of my stores

    <SelectionModel>
      <ext:RowSelectionModel ID="rsmMyGroup" runat="server" Mode="Single" >   
        <DirectEvents>
          <Select OnEvent="RowSelectGroup" Buffer="250">
            <EventMask ShowMask="true" Target="Page" />
            <ExtraParams>
              <ext:Parameter Name="myGroupID" Value="this.getSelected().get('myGroupID')" Mode="Raw" />
              <ext:Parameter Name="Values" Value="Ext.encode(#{gpMyGroups}.getRowsValues())" Mode="Raw" />
            </ExtraParams>
          </Select>
        </DirectEvents> 
      </ext:RowSelectionModel>
    </SelectionModel>
    
    protected void RowSelectGroup(object sender, Ext.Net.DirectEventArgs e)
      {
        //Comment: Sets fields in Details Panel
        string s = e.ExtraParams["Values"];
        Dictionary<string, string> MyGroup = Ext.Net.JSON.Deserialize<Dictionary<string, string>[]>(s)[0];
    
    
        string myGroupID = MyGroup["myGroupID"];  
        this.txtMyGroupID.Text = myGroupID;  //textbox to hold myGroupID value
        this.datasetPanel2.SelectParameters["myGroupID"].DefaultValue = myGroupID;
        this.storePanel2.DataBind();
    }
    Any help as to why the new model doesn't bind the details panel would be appreciated.
    Last edited by Daniil; Dec 22, 2015 at 4:52 PM. Reason: [CLOSED]
  2. #2
    Hi @jmilton,

    It is difficult to say anything certain without a test case to reproduce, but I also understand that it is difficult to provide a test case because of a dependency on SqlDataSource.

    Okay, first I'll try to ask something. Maybe, it will be enough to troubleshoot.

    Please post the definition of the storePanel2 Store and a response of a RowSelectGroup call.
  3. #3
    
    <ext:Store ID="storePanel2" runat="server" AutoLoad="true" DataSourceID="dsItemsInGroup"                             OnRefreshData="stItemsInGroup_RefreshData" >
      <Model>
        <ext:Model runat="server" ReaderID="myGroupList">
          <Fields>
            <ext:ModelField Name="MyGroupD" />
            <ext:ModelField Name="Item_ID" />
            <ext:ModelField Name="Item_Name" />
            <ext:ModelField Name="Item_Note" />
            <ext:ModelField Name="ItemCount" />
            <ext:ModelField Name="Active" />
          </Fields>
        </ext:Model>
      </Model>
      <Listeners>
        <Exception Handler="Ext.Msg.alert('List - Load failed', e.message || response.statusText);" />
      </Listeners>
    </ext:Store>
    protected void stItemsInGroup_RefreshData(object sender, Ext.Net.StoreReadDataEventArgs e)
      {
        this.dsItemsInGroup.SelectParameters["MyGroupID"].DefaultValue = this.txtMyGroupID.Text.ToString();
        this.storePanel2.DataBind();
      }
    The RowSelect from the first grid is supposed to pass a parameter to the store for the second panel.

    In my first version (with Coolite) everything works. After I updated to the new version of Ext.Net - the myGroupId from the first grid doesn't seen to change (when a different row is selected) and the second grid doesn't load or refresh.
    Last edited by jmilton; Dec 08, 2015 at 12:20 PM.
  4. #4
    Thank you for posting the Store's configuration.

    There is no ReaderID property on a Model: ReaderID="myGroupList"

    Please put the Reader into the Store as follows:
    <ext:Store runat="server">
        <Reader>
            <ext:JsonReader>
                ...
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    If it doesn't help, then please post the Reader's definition and this request is actual:
    Please post ... a response of a RowSelectGroup call.

    As for:

    The RowSelect from the first grid is supposed to pass a parameter to the store for the second panel.
    Please clarify have you ensured by debugging that the parameter is still passed?

    In my first version (with Coolite) everything works. After I updated to the new version of Ext.Net - the myGroupId from the first grid doesn't seen to change (when a different row is selected) and the second grid doesn't load or refresh.
    Thanks for the details. We are now troubleshooting this issue with you.
  5. #5
    Previously I stated:
    <SelectionModel>
      <ext:RowSelectionModel ID="rsmMyGroup" runat="server" Mode="Single" >
        <DirectEvents>
          <Select OnEvent="RowSelectGroup" Buffer="250">
            <EventMask ShowMask="true" Target="Page" />
              <ExtraParams>
                <ext:Parameter Name="myGroupID" Value="this.getSelected().get('myGroupID')" Mode="Raw" />
                <ext:Parameter Name="Values" Value="Ext.encode(#{gpMyGroups}.getRowsValues())" Mode="Raw" />
              </ExtraParams>
          </Select>
        </DirectEvents>
      </ext:RowSelectionModel>
    </SelectionModel>
    The One-To-Many example uses a different selection model:
    <SelectionModel>
      <ext:RowSelectionModel runat="server" Mode="Single">
        <Listeners>
          <Select Handler="if (#{pnlSouth}.isVisible()) {#{Store2}.reload();}" Buffer="250" />
        </Listeners>
      </ext:RowSelectionModel>
    </SelectionModel>
    In my example, the value of e.ExtraParameter doesn't change when a new row is selected and only passes the value of myGroupID from the first row in the grid.
  6. #6
    Thank you for the details.

    I noticed that you don't use this Parameter in the RowSelectGroup server side handler.
    <ext:Parameter Name="myGroupID" Value="this.getSelected().get('myGroupID')" Mode="Raw" />
    You always take the first record:
    Dictionary<string, string> MyGroup = Ext.Net.JSON.Deserialize<Dictionary<string, string>[]>(s)[0];
  7. #7
    Daniil,

    Isn't that the first item in the string that is passed in the ExtraParameters and not the data from the first row of the top grid?
  8. #8
    string s = e.ExtraParams["Values"];     
    Dictionary<string, string> MyGroup = Ext.Net.JSON.Deserialize<Dictionary<string, string>[]>(s)[0];
    The MyGroup variable contains the first row of the gpMyGroups GridPanel.

    To get this
    <ext:Parameter Name="myGroupID" Value="this.getSelected().get('myGroupID')" Mode="Raw" />
    on server side please use
    e.ExtraParams["myGroupID"]
  9. #9
    Daniil,

    The value returned for e.ExtraParams["myGroupID"] is null.
  10. #10
    Please try to replace
    <ext:Parameter Name="myGroupID" Value="this.getSelected().get('myGroupID')" Mode="Raw" />
    with
    <ext:Parameter Name="myGroupID" Value="record.get('myGroupID')" Mode="Raw" />
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] MVC pass extra parameter to Store AjaxProxy Url.Action
    By registrator in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 21, 2015, 8:32 PM
  2. Cant Get Selected Rows Using Extra parameter
    By antoreegan in forum 2.x Help
    Replies: 1
    Last Post: Jul 23, 2013, 12:14 PM
  3. [CLOSED] [Razor] AjaxProxy pass extra parameter
    By boris in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 07, 2012, 8:15 AM
  4. [CLOSED] How to pass extra parameter on to TreeLoader
    By mxp in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 17, 2010, 2:40 PM
  5. Coolite MVC Extra Parameter does not work
    By okhans in forum 1.x Help
    Replies: 5
    Last Post: Jul 30, 2009, 3:15 PM

Posting Permissions