Results 1 to 3 of 3

Thread: data binding between widgetcolumn and store

  1. #1
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    470
    Answers
    19

    Default Answered: data binding between widgetcolumn and store

    I took one of the grid examples and made a column a widgetcolumn.



    Very cool and seems to work great!

    My question now is what the best practice is if you have a widget in the widgetcolumn that is an editor. In this example, if I edit the Company column for one of the rows, how would I get that edited value back to the store? I know other ways like the editor to edit a value in the grid, but I want to know if there is an easy widget way.

  2. Currently you need to do it manually. Have a look at how the slider updates in the Widget Grid example.

    In the future we'll probably look at ways of making this automatic (or configurable, at least).

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    Currently you need to do it manually. Have a look at how the slider updates in the Widget Grid example.

    In the future we'll probably look at ways of making this automatic (or configurable, at least).
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    470
    Answers
    19

    Default

    Thanks for the info - missed that example on first glance.

    Here's the code snippet in case anyone else is looking.

    Code:
    listeners: {
        change: function(slider, value) {
    
    
            // If the widget has been decorated by the WidgetColumn with context-returning methods
            // then extract data and update its context record.
            if (slider.getWidgetRecord) {
                var rec = slider.getWidgetRecord();
                if (rec) {
                    rec.set('progress', value);
                }
            }
        }
    }

Posting Permissions

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