Ext.create listWindow problem

Hi folks,

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

 

Here is the code:

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

@irfanh94 schrieb:
This is really exhausting with all these errors :(
And thank you all, very much for this help…

Yeah I know that. I think everyone experiences that when starting with backend development  Foot-in-Mouth

I try to explain it. Your …view.list.Markets class inherits from Shopware.grid.Panel.  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).

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

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

There’s the default configuration with detailed descriptions for all possible options. Especially the „hasOwnController“-Attributeis important.

Normally the 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, 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. 

Maybe you should tell us what you try to accomplish and we can tell you what would be best practice to actually accomplish it  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 some complicate relations / views / etc. on existing backend applications you have to write your own Ext.JS classes

cheers  Smile

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.

 

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 of customers markets I am getting on the errors, and all of them are only in ExtJS.

Then you should consider following things:

  • Recommended/Easiest: How about using the „MultiSelection“ attribute type? Attribute system (only suitable for not too large amount of entries)
    Example: nRMI3cb.png , You can customize this via custom ExtJS Components
  • If above doens’t help: How about letting your …view.list.Markets class inherit from Ext.grid.Panel instead of 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 :slight_smile:

1 „Gefällt mir“

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?