Results 1 to 6 of 6

Thread: viewModel idProperty in store trouble

  1. #1
    Sencha User
    Join Date
    Oct 2013
    Posts
    56
    Answers
    2

    Default viewModel idProperty in store trouble

    I know, that there is already some issues with this 'idProperty', I saw the threads, but I'm not sure that my question is the same. In short, when I specify an 'idProperty': 'numid' in viewModel stores, I expect, that when I will work with models, I will be able to get my 'numid' with such a method as rec.getId(). But no. It returns an internal id, not mine. Here is fiddle, see the console.log: https://fiddle.sencha.com/#fiddle/a9t
    Could anybody to explain me what I'm doing wrong?

  2. #2
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    27

    Default

    internalid is always generated even if you specify a idproperty. To get the value, you should use rec.get('numid')

  3. #3
    Sencha User
    Join Date
    Oct 2013
    Posts
    56
    Answers
    2

    Default

    I slightly change the fiddle example: https://fiddle.sencha.com/#fiddle/abv
    There you can see, that internalId is always equal to value of 'id' field, if it is present in model, whether I set an idProperty or not. idProperty is always equal to 'id', I can't change it. So I think that idProperty doesn't work. And if it will work, according to docs, it should be got by getId. Or getIdProperty?

  4. #4
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    13

    Default

    var me = this;
    // Ask user to confirm this action
    Ext.Msg.confirm('Confirm Delete', 'Are you sure you want to delete this task?', function(result) {
    // User confirmed yes
    if (result == 'yes') {
    var record = me.getViewModel().get('chartrecord'),
    store = me.getStore('crmChart');
    // Delete record from store
    store.remove(record.);
    }
    });

    doesnt work more
    this is from sample
    bug bug bug bug bug!!!!!!!!!!!!!!!!!!!!!!!! 3.1 1903 v
    pls, correct as soon as posible

  5. #5
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    13

    Default

    cant delete
    always sent 'id'
    • id: "extModel802-2"

  6. #6
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    13

    Default

    Code:
    writer: {                    type: 'json',
                        writeAllFields: true,     //  works now, but before was better (before 1903 version) 
                        rootProperty: 'data'
    like that is working
    now i can remove ththing from a store
    but it is not so good variant
    be waiting bug correction or ..

Posting Permissions

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