How can i get the IDProperty from the grid in SelectionChange event ?

  1. #1

    How can i get the IDProperty from the grid in SelectionChange event ?

    i try to send the IdProperty as parameter id to >> DirectMethod.
    in the examples and also in the forum i didn't see what i need...
    Please help.
  2. #2
    Hello!

    Did you declared IDProperty? Can you provide your sample?
  3. #3

    My Grid Sample

    Quote Originally Posted by Baidaly View Post
    Hello!

    Did you declared IDProperty? Can you provide your sample?
    this is my sample grid
    <ext:GridPanel ID="GridPanel1" runat="server" Title="Shippers" Frame="true" Height="400" >
                <Store>
                    <ext:Store ID="Store1" runat="server" DataSourceID="ObjectDataSource2">
                        <Model>
                            <ext:Model ID="Model1" runat="server" IDProperty="ShipperID">
                                <Fields>
                                    <ext:ModelField Name="CompanyName" />
                                    <ext:ModelField Name="Phone" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:Column ID="Column7" runat="server" DataIndex="CompanyName" Text="Company" Width="150" />
                        <ext:Column ID="Column8" runat="server" DataIndex="Phone" Text="Phone" Width="150" />
                    </Columns>
                </ColumnModel>
                <Listeners>
                    <SelectionChange Handler="#{DirectMethods}.LoadShipper(selected[0].data);" />
                </Listeners>
            </ext:GridPanel>


    i want to send the ID parameter from the grid to the server method to execute the load shipper data.
    hope i am clear enough.

    Thanks
    Last edited by Baidaly; Jul 06, 2013 at 7:27 PM. Reason: Please, don't forget the [CODE] tag
  4. #4
    Please, don't forget CODE tag: http://forums.ext.net/showthread.php?3440

    In your model I don't see IDProperty: ShipperID:

    <ext:Model ID="Model1" runat="server" IDProperty="ShipperID">
    	<Fields>
    		<ext:ModelField Name="ShipperID" />
    		<ext:ModelField Name="CompanyName" />
    		<ext:ModelField Name="Phone" />
    	</Fields>
    </ext:Model>
    In data field you can access your model's fields:

    #{DirectMethods}.LoadShipper(selected[0].data.ShipperID);
  5. #5
    Quote Originally Posted by Baidaly View Post
    Please, don't forget CODE tag: http://forums.ext.net/showthread.php?3440

    In your model I don't see IDProperty: ShipperID:

    <ext:Model ID="Model1" runat="server" IDProperty="ShipperID">
    	<Fields>
    		<ext:ModelField Name="ShipperID" />
    		<ext:ModelField Name="CompanyName" />
    		<ext:ModelField Name="Phone" />
    	</Fields>
    </ext:Model>
    In data field you can access your model's fields:

    #{DirectMethods}.LoadShipper(selected[0].data.ShipperID);


    Thank You :))

    Success

Similar Threads

  1. Replies: 5
    Last Post: Feb 20, 2013, 4:29 AM
  2. Replies: 1
    Last Post: Jan 12, 2013, 4:47 AM
  3. Replies: 0
    Last Post: Sep 06, 2012, 12:11 PM
  4. Does MultiSelect has a SelectionChange event?
    By gmpd123 in forum 2.x Help
    Replies: 1
    Last Post: Jul 28, 2012, 8:10 PM
  5. Replies: 0
    Last Post: May 16, 2012, 4:35 PM

Posting Permissions