[CLOSED] RowExpander FormPanel Issues

  1. #1

    [CLOSED] RowExpander FormPanel Issues


    I defined a RowExpander FormPanel in my GridPanel as follows:

    <ext:RowExpander runat="server" SingleExpand="false">
    					FieldLabel="Account Type">   
    						<ext:ListItem  Text="GL" Value="GL"></ext:ListItem>
    							<ext:ListItem  Text="GL" Value="GL"></ext:ListItem>
    							<ext:ListItem  Text="Customer" Value="Customer"></ext:ListItem>
    							<ext:ListItem  Text="Supplier" Value="Supplier"></ext:ListItem>
    							<Select Handler="loadAccountNum" />
    				<ext:ComboBox ID="ddlAccountNo" ClientIDMode="Static" Flex="1" ForceSelection="true"  ValueField="SL_ACCOUNT" DisplayField="SL_ACCOUNT" runat="server"  LabelAlign="Left" FieldLabel="Account No.">
    						<ext:Store ID="ddlAccountNoStore" runat="server">
    								<ext:Model ID="ddlAccountNoModel" runat="server" >
    										<ext:ModelField Name="SL_ACCOUNT_DESC" Type="String" />
    										<ext:ModelField Name="SL_ACCOUNT"   Type="String" />
    					FieldLabel="Subledger Acc"
    					FieldLabel="Control Acc"
    					FieldLabel="Acc Desc."
    What I want to achieve is the following:

    1. For each row in my editable GridPanel, the user will choose "Account Type" from ComboBox.
    2. Based on the selection "Account No." list will be displayed in second ComboBox of the same form.

    Note that I defined the ID property for each ComboBox as ClientIDMode="Static".

    My questions are:

    1. As per my GridPanel has many rows, how I can deal with each FormPanel component separately.

    2. How to sync the values of FormPanel to the GridPanel store (Note that fields are mapped with Name= property).

    3. I defined a listeners in ComboBox as follows:

    	<Select Handler="loadAccountNum" />
    to invoke this:

    function loadAccountNum() {
        var AccountType = App.ddlAccountType.getValue();
    But this listener is not FIRED, why? What am doing wrong?

    Last edited by fabricio.murta; Mar 08, 2016 at 1:28 AM.
  2. #2
    Hello Alaswad!

    Question 1:
    I can suggest you using row expander's SingleExpand="true" and also CacheSingleExpandRows="true". This will allow you to access the form thru its unique ID. Why:
    1. SingleExpand ensures only one instance of the inner components are used
    2. CacheSingleExpandRows makes it so the components are just moved between expanded rows instead of being redrawn

    This way, expanding a row is equivalent to just making a bare container and moving the expander's components there and updating the fields/contents' values.

    The only drawback here is that you can have just one row expanded at a time -- but it also means better performance for bigger grids as less resources are necessary!

    Question 2:
    Follow this example: RowExpander Plugin with FormPanel Detail

    Question 3:
    You are mistaking the Handler with the Fn properties.
    Handler property: Runs the JavaScript code enclosed by double quotes when the event is triggered.
    Fn property: Forwards the parameters of the event to the specified JavaScript function. It assumes the function has the same function signature (parameters) than the event function itself.

    These two properties are mutually exclusive, and the parameters (reachable in Handler, passed in Fn) are, in this order, item and records, representing the combo box component and selected record or records (in case of multi select combo box), respectively.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank You.

    It works but without setting this CacheSingleExpandRows="true" , when I do that I become unable to get forms component values through:

  4. #4
    Yes! Actually I got it to you the wrong way! By caching the expand rows, it keeps the component in place instead of moving/refilling the components thru the rows, so you end up with several copies of the component -- thus they are created with random ids as it has to be unique on the page!

    But I am glad you could figure the final bit out! Sorry for the confusion!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. RowExpander Sub-Grid remote loading issues
    By mrmalaa in forum 3.x Help
    Replies: 4
    Last Post: Apr 03, 2015, 8:58 PM
  2. Replies: 4
    Last Post: Jan 18, 2015, 5:51 PM
  3. [CLOSED] FormPanel anchor and label align issues
    By RCN in forum 3.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 25, 2014, 7:23 PM
  4. [CLOSED] GridPanel RowExpander issues
    By jpadgett in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: May 12, 2014, 3:47 PM
  5. [CLOSED] RowExpander with more then one formpanel
    By trePjt in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Oct 03, 2013, 12:21 PM

Posting Permissions