Results 1 to 9 of 9

Thread: Upgraded to ST2.1 just broke my dataview

  1. #1
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    245
    Answers
    6
    Vote Rating
    2
      0  

    Default Upgraded to ST2.1 just broke my dataview

    Hi guys,

    I've just upgraded from ST2.0.0 to ST2.1. I'm getting the following error (attached image)...

    Screen Shot 2012-11-07 at 11.21.45 AM.jpg

    Note that "app.js.716" points to my dataview (below the error)
    Code:
            var schedule = Ext.create('Ext.DataView', {
                itemTpl: tpl,
                store: offlineStore,
                scrollable: true,
                emptyText: '<div style="margin-top: 20px; text-align: center">empty nothing</div>',
    ....
    Can anyone advise please?

    Thank you,
    Riyaad

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Looks like you are trying to use the PullRefresh plugin. This was only ever meant to work with Ext.dataview.List so it may have worked before but was not meant to work in Ext.dataview.DataView
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    245
    Answers
    6
    Vote Rating
    2
      0  

    Default

    Hi Mitchell,

    That would be correct, I'm using the PullRefresh plugin to allow the user to update his/her details in the dataview (info being pulled from offline store etc). So are you saying that as of v2.1 that this is no longer allowed in the dataview and that I may need to use the list instead (unless I decide to remove the PullRefresh plugin)?

    Regards
    R

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Correct. That plugin is designed to only work with List and the List in 2.1 has changed to support infinite scrolling.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    82
    Answers
    4
    Vote Rating
    3
      0  

    Default

    Hi,

    Thanks for that info. I think the documentation should be updated to reflect this. Will add a comment now.

    Thanks,

    Matt

  6. #6
    Sencha Premium Member
    Join Date
    Oct 2012
    Location
    Antibes
    Posts
    93
    Answers
    7
    Vote Rating
    0
      0  

    Default How can i access to this plugin

    i want the pullrefresh plugin (on my Ext.List) but where do i find the plugin ?

    thanks

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    443
    Answers
    5
    Vote Rating
    18
      0  

    Default

    I had a similar problem, and ended up making a copy of the PullRefresh plugin, but without the List-specific code.

    I think this plugin would be a good candidate for refactoring. There's the user-interface portion, which people might want to use on any component. And then there's the store-related code, which is only useful for DataViews. Maybe the latter could be moved into an adapter class, so the UI code is more reusable.

  8. #8
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    22
    Vote Rating
    0
      0  

    Default

    Would you mind posting that code? I am using both PullRefresh and ListPaging plugins with my DataViews.

  9. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    443
    Answers
    5
    Vote Rating
    18
      0  

    Default

    To make it work with DataView, I think you only need to change line 147:

    Code:
            list.container.insert(0, me);
    to something like:

    Code:
            list.container ? list.container.insert(0, me) : list.insert(0, me);
    My code has gone in a different direction since I did this, so there might be other changes that I forgot about.

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
  •