Results 1 to 8 of 8

Thread: ExtJS4: Use panel or Window?or Container?

  1. #1

    Default ExtJS4: Use panel or Window?or Container?

    Hey all,

    I am working on an application where my requirement is to develop the following screens:
    1. Add screen to accept user input( form panel )
    2. View details screen to display the user input( grid panel)
    3. Edit screen to edit the user input ( not sure if it should be form or window).

    I have a 'itemdblclick' listener for the grid panel..so when the user double clicks on a grid row, the edit screen has to open up with the details populated in the fields.

    I want to use a common class for both add and edit screens, But the issue here is,
    If I extend a Window, the edit screen comes up but not add screen whereas If I extend a Panel, then the add screen opens up but edit screen does not come up..

    Code:
     
    Ext.define('ELM.view.cl.Edit',{    extend : 'Ext.window.Window',
            ...
    Code:
    Ext.define('ELM.view.cl.Edit',{
        extend : 'Ext.form.Panel',
        ...
    Note: I have a tab panel in which I am adding the add and view screen as different tabs, whereas edit screen is just a window.

    As far as I know, probably the tabpanel cannot have window as a child component.
    Please tell me what is wrong here? Should I extend a 'container' instead and may be specify 'formpanel' and 'window' in some other place. ? How do I achieve my requirement?
    Any references will help..

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Is the form the same for add and edit?

  3. #3

    Default

    Yeah it is the same.. I just have to populate the values stored into the fields in case of edit screen.

  4. #4
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Sounds like you can define your form and then use an instance of it in the add tab, edit tab, and as a single child item of a Window for edits as needed.

  5. #5

    Default

    Well, when defining the form...should I extend Ext.form.Panel or something else?

  6. #6
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Yeah, that's what I would do. It gives you some convenience methods like loadRecord and getValues and a few others that makes working with user form data easy. For example, you might want to use loadRecord when you doubleclick on a grid row to load that record to the form.

  7. #7

    Default

    Thanks... It will be very helpful for me to understand, if you could provide some references or links on how exactly I will be able to do that..

  8. #8

    Default

    @slemmon Defining it as a form panel and adding it as the child of a window worked perfectly. Thanks a lot

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •