Results 1 to 3 of 3

Thread: Propagate viewModel in run time created component

  1. #1
    Sencha Premium User
    Join Date
    Jul 2016
    Posts
    9
    Answers
    1

    Exclamation Answered: Propagate viewModel in run time created component

    Hello,
    I'm facing a problem, I have a list with a viewModel, a store inside the view model. List item is in another js file, no view model for it, if in my list view I have this item already declared then it's ok, it retrieve the list vm, but if I add one list item by code in the listController then it doesn't retrieve the vm and crash saying Cannot use bind config without a viewModel

    Here's a fiddle: https://fiddle.sencha.com/#fiddle/25be

    Regards.

  2. Following seems to work:
    Code:
    var item = Ext.create({ 
                xtype: 'victimeitem',
                viewModel: {
                    parent: vm
                }
            });

  3. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    908
    Answers
    105

    Default

    Following seems to work:
    Code:
    var item = Ext.create({ 
                xtype: 'victimeitem',
                viewModel: {
                    parent: vm
                }
            });

  4. #3
    Sencha Premium User
    Join Date
    Jul 2016
    Posts
    9
    Answers
    1

    Thumbs up thanks

    Thanks a lot!!!! the parent key does the magic!

    I've tried this
    Code:
    var item = Ext.create({ 
                xtype: 'victimeitem',
                viewModel: vm
            });
    but removing one item removed the parent vm.

Similar Threads

  1. Replies: 2
    Last Post: 16 Feb 2016, 9:03 AM
  2. viewModel.bind only called one time
    By SebTardif in forum Ext 5: Bugs
    Replies: 1
    Last Post: 10 Oct 2014, 10:26 PM
  3. Each time I upgrade Ext JS a new app.js is created
    By SebTardif in forum Sencha Cmd
    Replies: 0
    Last Post: 3 Oct 2014, 10:06 AM
  4. Replies: 1
    Last Post: 30 Jul 2014, 2:53 PM

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
  •