Problem using new <ext-partial> component

  1. #1

    Problem using new <ext-partial> component

    I have the following partial view

    @model TMSWeb.ExtNETCore.Pages.Shared.FlagsPartialModel
    @{
        Html.X().FieldSet()
                .Title("Flags")
                .Width(400)
                .Layout(LayoutType.Container)
                .RenderTo("PanelFlags")
                .Items(
                    Html.X().CheckboxGroup()
                        .Name("Flags")
                        .Items(Model.Checkboxes)
                );
    }
    that I am trying to host in a panel on a parent page

    <ext-panel id="PanelFlags">
      <items>
        <ext-partial name="_Flags"
                     model='new FlagsPartialModel { ObjectId = 117, Flags = 17 }' />
      </items>
    </ext-panel>
    The page fails to render with the error

    Cannot read property 'dom' of null
    at constructor.doInsert (ext-all-debug.js:128095)
    at constructor.append (ext-all-debug.js:128068)
    at constructor.render (ext-all-debug.js:70846)
    at constructor (ext-all-debug.js:74177)
    at new Ext.form.FieldSet (ext-all-debug.js:14564)
    at eval (eval at getInstantiator (ext-all-debug.js:16491), <anonymous>:3:8)
    at Object.create (ext-all-debug.js:17025)
    at Customers:18
    at Object.invoke (ext-all-debug.js:20532)
    at Object.doInvokeAll (ext-all-debug.js:20576)
    Looking at the JavaScript code that is generated, the framework is trying to create the FieldSet component in the child partial view before the components in the parent view have been created. So the 'PanelFlags' component that has been specified as the target to render the FieldSet to hasn't been created yet.

    Is there something that I'm missing here? What needs to be changed to ensure that the components in the child view are created after those in the parent view?
  2. #2
    Hello @plok77!

    The ext-partial component is not currently the same in capabilities as Ext.NET 5's partial view. Please check out GitHub issue #1819 for more information on the current state of Partial Views support in Ext.NET 7. As pointed in the issue, you can see the current implementation of ext-partial in action if you install the Ext.NET template.

    In short, the ext-partial component is paired with the ext-section to compose a view based on its layout page.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Dec 21, 2015, 7:11 PM
  2. Replies: 7
    Last Post: Sep 12, 2014, 4:49 PM
  3. [CLOSED] Problem rendering partial view
    By T3rryChan in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 03, 2012, 9:22 PM
  4. Add Ext JavaScript Component to Component
    By geoffrey.mcgill in forum Examples and Extras
    Replies: 3
    Last Post: Mar 10, 2010, 12:38 PM
  5. Problem in Partial Render of an ascx in MVC
    By aliassaf in forum 1.x Help
    Replies: 0
    Last Post: Nov 05, 2009, 5:22 AM

Posting Permissions