1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    2
    Vote Rating
    0
    cmcguire@citadel.com is on a distinguished road

      0  

    Default Accessing record data from an external mousedown event.

    Accessing record data from an external mousedown event.


    Hello,

    I have a grid which includes a combobox. The first time a value from the combobox is selected I need to store that value so that I can repopulate the combobox later. Later when a user clicks on a checkbox from the same row I need to get access to the original value that was stored for that row. Essentially I want to add an 'originalValue' record to the record, which I can later access from the checkboxes onMouseDown event. I am using Ext 3.4. What is the best way to set and access this data?

    Thanks for any help you can provide

    Code:
    Ext.grid.CheckColumn.prototype = {...
            onMouseDown : function(e, t) {
                // Determine if this is a checkbox click
                if (t.className
                        && t.className.indexOf('x-grid3-cc-' + this.id) != -1) {
                    // Manually set the value of the checkbox
                    e.stopEvent();
                    var rowIndex = this.grid.getView().findRowIndex(t);
                    var record = this.grid.store.getAt(rowIndex);
                    if (this.dataIndex == "reconfirmTrade") 
                        console.log(record.get('originalValue')); //comes back undefined
                        record.set(this.dataIndex, !record.data[this.dataIndex]);
                    ...
            }
    
    //on combobox i set the record when the item is selected.
    
    'select' : function(combo, record, index) {
                    if (this.originalValue == null || this.originalValue == '')
                                            {
                                                record.set('originalValue', this.startValue);
                                            }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,412
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The record should keep track of any modifications. Have you inspected the record object itself?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2013
    Posts
    2
    Vote Rating
    0
    cmcguire@citadel.com is on a distinguished road

      0  

    Default Mitchell

    Mitchell


    Hi Mitchell,

    Thanks for your response. I did find a 'modified' member on record object which I was able to use.

Thread Participants: 1

Tags for this Thread