[CLOSED] RowExpander Renderer and store bind on this.record

  1. #1

    [CLOSED] RowExpander Renderer and store bind on this.record

    .Plugins(
        X.RowExpander()
            .Renderer("if (record.Splits.lenght === 0)  { return false; }")
            .SingleExpand(false)
            .Component(X.GridPanel()
                .HideHeaders(true)
                .Store(X.Store().ModelName("UsageDataModelList"))
                .ColumnModel(
                    X.Column().Text("").Width(82),
                    X.DateColumn().Text("Date").DataIndex("DATE").Width(90),
                    X.Column().Text("Ref").DataIndex("REFERENCE").Width(60),
                    X.Column().Text("").Width(120),
                    X.Column().Text("Details").DataIndex("DETAILS").Width(240)
                   )
                .Listeners(l =>
                {
                    l.ViewReady.Handler = "this.bindStore(record.usages);";
                    l.ViewReady.Delay = 1;
                })
            )
            
    )
    This is my Row Expander but it doesn't work well. The selected record has a Splits property which is a List<Class>
    This list should be presented in the expanding grid.
    How can I get the actual Splits property from the record please?

    THank you
    Last edited by Daniil; Jun 08, 2015 at 10:16 AM. Reason: [CLOSED]
  2. #2
    Hi @registrator,

    This example might help you to start with.
    https://examples2.ext.net/#/Associations/HasMany/Simple

    Well, if you have not already seen that.
  3. #3
    Yes, this is the sample I was following and there you have

    this.bindStore(this.record.products());
    When I do this in my code

     this.bindStore(this.record.splits());
    I get a message that splits() in not a function.

    I am not sure how to get my splits list and what does the products() actually refers to because even in the sample the products() as function does not exist.

    Thank you
    Last edited by Daniil; May 22, 2015 at 11:16 AM.
  4. #4
    Hi

    I get a message that splits() in not a function.
    Did you define associations in the store like in online example?
    Please define simple test sample which demonstrates the issue and we will help you
  5. #5
    This is the association defined:

    .Associations(a => a.Add(X.HasManyAssociation()
                                                                .Model("SplitDataModelList")
                                                                .Name("Splits")
                                                                .AssociationKey("Splits")
                                                ))
    what is the Splits() function above? Name or Association Key?
    There is not explanation with the example so I was guessing what relates to what
    Last edited by registrator; May 25, 2015 at 2:52 PM.
  6. #6
    These links should be helpful.
    http://docs.sencha.com/extjs/4.2.1/#...associationKey
    http://docs.sencha.com/extjs/4.2.1/#...sMany-cfg-name

    According to the description it is a HasManyAssociation's Name.

    Please note that it is case sensitive.

Similar Threads

  1. Replies: 2
    Last Post: Aug 07, 2014, 3:56 PM
  2. [CLOSED] ROWEXPANDER: not able to read record from listener on expand
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 08, 2013, 4:28 AM
  3. [CLOSED] Bind GridPanel in RowExpander
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 23, 2011, 1:58 PM
  4. [CLOSED] Gridpanel record bind
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 03, 2009, 5:27 AM
  5. Rowexpander renderer
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 21, 2008, 4:29 AM

Posting Permissions