# How can I extend backend extjs?

**URL:** https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574
**Category:** International (English Only)
**Tags:** programming
**Created:** [28. Juni 2017 um 08:28 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574 "2017-06-28T08:28:44Z")
**Posts on this page:** 9
**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: [28. Juni 2017 um 08:28 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/1 "2017-06-28T08:28:44Z")

</div>

Hi folks,

I am developing backend plugin, and what I have to do is to extend customer detail page.

For example, when administrator click on the customer, and customer detail page is opened, I want to create another tab called „Markets“ where is going to be a list of markets of that customer.

Thanks in advance!

&nbsp;

---

<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: [28. Juni 2017 um 08:56 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/2 "2017-06-28T08:56:12Z")

</div>

There’s a tutorial at&nbsp;[https://developers.shopware.com/developers-guide/backend-extension/#example-#2:-custom-components](https://developers.shopware.com/developers-guide/backend-extension/#example-#2:-custom-components)

> In some cases, you also want to add whole new components to a backend module. This example might look similar to the first one, but there are subtle changes. In this example, a **new tab is introduced to the customer module** ,[…]

&nbsp;

---

<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: [28. Juni 2017 um 09:00 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/3 "2017-06-28T09:00:41Z")

</div>

I followed this tutorials, but it didnt work.  
&nbsp;

In the Views dir, there is an structure:  
&nbsp;– backend  
&nbsp;---- pe\_markets  
&nbsp;------ controller  
&nbsp;------ model  
&nbsp;------ store

So, should I create new directory in backend, called for example “pe\_customers” and then work in pe\_customers/app.js, or I have to work in pe\_markets/app.js to create new tab in customer detail page?

---

<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: [28. Juni 2017 um 09:04 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/4 "2017-06-28T09:04:16Z")

</div>

You need to share more of your code. How does your event-listener php-function look like? How does your Ext.JS Code look like? Sorry but with this little information we can’t help you. It doesn’t depend on the structure only&nbsp;and the mistake is more likely somewhere else.

---

<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: [28. Juni 2017 um 09:23 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/5 "2017-06-28T09:23:07Z")

</div>

Here is my code:

- **directory structure**  
[https://image.ibb.co/gXYgck/Screen\_Shot\_2017\_06\_28\_at\_11\_07\_57.png](https://image.ibb.co/gXYgck/Screen_Shot_2017_06_28_at_11_07_57.png)  
&nbsp;
- **plugins/PeCustomers/PeCustomers.php**  
[https://image.ibb.co/c3xDq5/Screen\_Shot\_2017\_06\_28\_at\_11\_06\_58.png](https://image.ibb.co/c3xDq5/Screen_Shot_2017_06_28_at_11_06_58.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/app.js**  
[https://image.ibb.co/kZJHiQ/Screen\_Shot\_2017\_06\_28\_at\_11\_13\_22.png](https://image.ibb.co/kZJHiQ/Screen_Shot_2017_06_28_at_11_13_22.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/controller/main.js**  
[https://image.ibb.co/mrfmck/Screen\_Shot\_2017\_06\_28\_at\_11\_14\_42.png](https://image.ibb.co/mrfmck/Screen_Shot_2017_06_28_at_11_14_42.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/model/market.js**  
[https://image.ibb.co/dhYiOQ/Screen\_Shot\_2017\_06\_28\_at\_11\_15\_53.png](https://image.ibb.co/dhYiOQ/Screen_Shot_2017_06_28_at_11_15_53.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/store/list.js**  
[https://image.ibb.co/fi4CHk/Screen\_Shot\_2017\_06\_28\_at\_11\_17\_28.png](https://image.ibb.co/fi4CHk/Screen_Shot_2017_06_28_at_11_17_28.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/view/detail/market.js**  
[https://image.ibb.co/cgbbck/Screen\_Shot\_2017\_06\_28\_at\_11\_18\_53.png](https://image.ibb.co/cgbbck/Screen_Shot_2017_06_28_at_11_18_53.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/view/detail/window.js**  
[https://image.ibb.co/nHKJq5/Screen\_Shot\_2017\_06\_28\_at\_11\_19\_40.png](https://image.ibb.co/nHKJq5/Screen_Shot_2017_06_28_at_11_19_40.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/view/list/market.js**  
[https://image.ibb.co/gjM3OQ/Screen\_Shot\_2017\_06\_28\_at\_11\_21\_48.png](https://image.ibb.co/gjM3OQ/Screen_Shot_2017_06_28_at_11_21_48.png)  
&nbsp;
- **plugins/PeCustomers/Resources/views/backend/pe\_markets/view/list/window.js**  
[https://image.ibb.co/dE2XHk/Screen\_Shot\_2017\_06\_28\_at\_11\_22\_29.png](https://image.ibb.co/dE2XHk/Screen_Shot_2017_06_28_at_11_22_29.png)

---

<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: [28. Juni 2017 um 09:45 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/6 "2017-06-28T09:45:52Z")

</div>

In the tutorial they add a Event-Listener to the&nbsp;Enlight\_Controller\_Action\_PostDispatchSecure\_Backend\_Customer-Event. **That’s missing in your implementation.&nbsp;**

Search for „Enlight\_Controller\_Action\_PostDispatchSecure\_Backend\_Customer“ in the tutorial and you’ll find the coresponding information.

---

<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: [28. Juni 2017 um 09:49 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/7 "2017-06-28T09:49:38Z")

</div>

I am going to try it. Will be back with news in few minutes.  
Thank you !

---

<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: [28. Juni 2017 um 10:27 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/8 "2017-06-28T10:27:41Z")

</div>

Not working again. I am getting an error "SyntaxError: Unexpected token : " as soon as I refresh backend, but as mine eyes can see, there is no such an error 😕  
&nbsp;

- **plugin/PeCustomers/PeCustomers.php**  
[https://image.ibb.co/hakmv5/Screen\_Shot\_2017\_06\_28\_at\_12\_23\_49.png](https://image.ibb.co/hakmv5/Screen_Shot_2017_06_28_at_12_23_49.png)  
&nbsp;
- **plugin/PeCustomers/Resources/views/backend/pe\_customers/app.js**  
[https://image.ibb.co/gCeeF5/Screen\_Shot\_2017\_06\_28\_at\_12\_18\_19.png](https://image.ibb.co/gCeeF5/Screen_Shot_2017_06_28_at_12_18_19.png)  
&nbsp;
- **plugin/PeCustomers/Resources/views/backend/pe\_customers/view/detail/window.js**  
[https://image.ibb.co/e2ovoQ/Screen\_Shot\_2017\_06\_28\_at\_12\_20\_50.png](https://image.ibb.co/e2ovoQ/Screen_Shot_2017_06_28_at_12_20_50.png)  
&nbsp;
- **plugin/PeCustomers/Resources/views/backend/pe\_customers/view/detail/my\_own\_tab.js**  
[https://preview.ibb.co/fC1LNk/Screen\_Shot\_2017\_06\_28\_at\_12\_22\_15.png](https://preview.ibb.co/fC1LNk/Screen_Shot_2017_06_28_at_12_22_15.png)  
&nbsp;
- **ERROR**  
[https://image.ibb.co/jHipF5/Screen\_Shot\_2017\_06\_28\_at\_12\_25\_30.png](https://image.ibb.co/jHipF5/Screen_Shot_2017_06_28_at_12_25_30.png)

---

<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: [28. Juni 2017 um 12:25 UTC](https://forum.shopware.com/t/how-can-i-extend-backend-extjs/46574/9 "2017-06-28T12:25:45Z")

</div>

Error is fixed.

I had to name the block in my\_own\_tab.js file, example:  
//{block name=„Shopware.apps.PeCustomers.view.detail.MyOwnTab“}
