Results 1 to 2 of 2

Thread: Checkbox Selection Model cannot check a row using a newly created record

  1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    44

    Default Checkbox Selection Model cannot check a row using a newly created record

    I am having difficulty checking a row manually in a grid which is using Ext.selection.Model. I am trying to use select function and it works if I pass index of the record that I need to check, it even works if I do something like select(store.getAt(index)) but if I try to create a record myself as following
    var record = Ext.create('User', {ID: '10', MyID: '10', Name:'David'});
    then it doesn't work, I am sure that there is a record with id 10.
    My model is as follows
    Ext.define('User', {
    //extend: 'Ext.selection.Model',
    extend: 'Ext.data.Model',
    idProperty: 'MyID',
    fields: [
    {name: 'MyID', type: 'string'},
    {name: 'ID', type: 'string',
    {name: 'Name', type: 'string'}
    ]
    });

    The collection named 'selected' which stores the checked records in the selection model does gets updated and has the newly created record in it.

    Any help will be much appreciated.
    Thanks.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Do you insert var record = Ext.create('User', {ID: '10', MyID: '10', Name:'David'}); into the store?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

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