# Ext.create listWindow problem

**URL:** <https://forum.shopware.com/t/ext-create-listwindow-problem/46693>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [4. Juli 2017 um 10:21 UTC](https://forum.shopware.com/t/ext-create-listwindow-problem/46693 "2017-07-04T10:21:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![irfanh94](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@irfanh94](https://forum.shopware.com/u/irfanh94)\
**Post date:** [4. Juli 2017 um 10:21 UTC](https://forum.shopware.com/t/ext-create-listwindow-problem/46693/1 "2017-07-04T10:21:22Z")

</div>

Hi folks,

When I call Ext.create to inject list window into tab, error ( **Uncaught TypeError: Cannot read property ‘control’ of undefined** ) happens.

&nbsp;

Here is the code:

- **detail/window.js**  
[https://image.ibb.co/coqZ4a/Screen\_Shot\_2017\_07\_04\_at\_12\_17\_03.png](https://image.ibb.co/coqZ4a/Screen_Shot_2017_07_04_at_12_17_03.png)  
&nbsp;
- **list/markets.js**  
[https://image.ibb.co/hAqTVF/Screen\_Shot\_2017\_07\_04\_at\_12\_18\_33.png](https://image.ibb.co/hAqTVF/Screen_Shot_2017_07_04_at_12_18_33.png)

This is really exhausting with all these errors ☹  
And thank you all, very much for this help…

---

<div class="post-metadata">

**Author:** ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)\
**Post date:** [4. Juli 2017 um 16:39 UTC](https://forum.shopware.com/t/ext-create-listwindow-problem/46693/2 "2017-07-04T16:39:13Z")

</div>

> [@irfanh94 schrieb:](https://forum.shopware.com/profile/26658/irfanh94 "irfanh94")  
> This is really exhausting with all these errors ![:(](https://dub1.discourse-cdn.com/flex013/resources/emoji/frowning.png ":(")  
> And thank you all, very much for this help…

Yeah I know that. I think everyone experiences that when starting with backend development&nbsp; ![Foot-in-Mouth](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/bedbc37f276faa6d086ddea9cd70cb0550bbd56e.png "Foot-in-Mouth")

I try to explain it. Your …view.list.Markets class inherits from Shopware.grid.Panel. &nbsp;Shopware.grid.Panel is part of the **Shopware backend components** , which have specific restrictions you need to follow. That’s a complicate topic and it really helps to do the **Shopware backend components** tutorial. (At least the basic one [Backend Components - Basics](https://developers.shopware.com/developers-guide/backend-components/basics/)).

After you’ve done it &nbsp;have a look into the&nbsp;Shopware.grid.Panel class:

[https://github.com/shopware/shopware/blob/5.2/themes/Backend/ExtJs/backend/base/application/Shopware.grid.Panel.js#L229](https://github.com/shopware/shopware/blob/5.2/themes/Backend/ExtJs/backend/base/application/Shopware.grid.Panel.js#L229)

There’s the [default configuration](https://github.com/shopware/shopware/blob/5.2/themes/Backend/ExtJs/backend/base/application/Shopware.grid.Panel.js#L246) with detailed descriptions for all possible options. Especially the [„hasOwnController“-Attribute](https://github.com/shopware/shopware/blob/5.2/themes/Backend/ExtJs/backend/base/application/Shopware.grid.Panel.js#L275)is important.

Normally the&nbsp;Shopware.grid.Panel is created by Shopware itself (if you use the backend components as described in the tutorial). If you create it on your own and don’t the set [„hasOwnController“ property,](http://github.com/shopware/shopware/blob/5.2/themes/Backend/ExtJs/backend/base/application/Shopware.grid.Panel.js#L275) the component will create another controller (what you normally do not want)! I think here’s the problem as you’re working inside the Customer-Application. Backend components are meant for standalone applications to easily cover CRUD operation on your custom models.&nbsp;

**Maybe you should tell us what you try to accomplish and we can tell you what would be best practice to actually accomplish it&nbsp; ![Wink](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/b3785da0cbf2c8566cb535dcf55b2730b5224899.png "Wink")**

- You have your own custom database models and want the user to easily do CRUD operations on them? =\> use the Shopware Backend components
- You want to save additional data within an exisiting Shopware model =\> use attributes
- You need to realize&nbsp;some complicate relations / views / etc. on existing backend applications you have to write your own Ext.JS classes

cheers&nbsp; ![Smile](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/bac5f5766b6a20565a8fb995345b4e41d24daac0.png "Smile")

---

<div class="post-metadata">

**Author:** ![irfanh94](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@irfanh94](https://forum.shopware.com/u/irfanh94)\
**Post date:** [5. Juli 2017 um 06:38 UTC](https://forum.shopware.com/t/ext-create-listwindow-problem/46693/3 "2017-07-05T06:38:33Z")

</div>

Hi @simkli‍…

Well, since I am new at the Symfony, Doctrine and ExtJS I am trying to do custom things to get more clear what is happening and how its happening in Shopware.  
I am reading this documentation but there is a lot of things for me to understand in short time.

So, this is what I am trying to accomplish.

- I have a task which is requesting from me to extend Customers in backend of Shopware.
- I need to create “Markets” section
- I need to create “Markets” tab for every single customer where is the list of the markets added to its customers.

&nbsp;

I have already created Markets section where administrator can do simple CRUD functions but with custom repository, and everything is working fine.  
But now, when I am trying to extend customers tab with preview as a list&nbsp;of customers markets I am getting on the errors, and all of them are only in ExtJS.

---

<div class="post-metadata">

**Author:** ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)\
**Post date:** [5. Juli 2017 um 07:55 UTC](https://forum.shopware.com/t/ext-create-listwindow-problem/46693/4 "2017-07-05T07:55:31Z")

</div>

Then you should consider following things:

- Recommended/Easiest:&nbsp;How about using the „MultiSelection“&nbsp;attribute type?&nbsp;[Attribute system](https://developers.shopware.com/developers-guide/attribute-system/) (only suitable for not too large amount of entries)  
Example:&nbsp;[nRMI3cb.png](http://i.imgur.com/nRMI3cb.png)&nbsp;, You can customize this via custom ExtJS Components
- If above doens’t help: How about letting your&nbsp;…view.list.Markets class inherit from Ext.grid.Panel instead of&nbsp;Shopware.grid.Panel ?
- If that’s not what you want: Then you should set the „hasOwnController“-Property to false and handle the events on your own

Cheers 🙂

---

<div class="post-metadata">

**Author:** ![irfanh94](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@irfanh94](https://forum.shopware.com/u/irfanh94)\
**Post date:** [5. Juli 2017 um 12:17 UTC](https://forum.shopware.com/t/ext-create-listwindow-problem/46693/5 "2017-07-05T12:17:19Z")

</div>

Well, the first option is not good since I am going to have many attributes for sure.

If I use the second options, and set view.list.Markets class inherit from Ext.grid.Panel instead of Shopware.grid.Panel then another error shows up: Uncaught TypeError: Cannot read property ‘items’ of undefined.

Now I have tried with third option, and there is no more errors, but nothing is shown which is quite good because I am going to make custom functions for listing.  
Is there any tutorial on how to make custim listing in shopwares backend?

&nbsp;
