Translate

Scroll to a given item in a dataview - Sencha Touch

In my Sencha Touch app I had a component dataview. I had included an index bar and I needed to scroll to the relevant items when I click on index bar. This is what I did.

Here recordIndex is the index of the component in dataview that we need to scroll to.

11 comments:

  1. hey,
    Its not work for me
    I have this error Uncaught TypeError: Cannot read property 'element' of undefineditemsingletap

    ReplyDelete
  2. Can you post your code snippet here.

    ReplyDelete
    Replies
    1. ```itemsingletap: function(list, index, target, record, e, eOpts ) {


      p_scor_controller.ok = false;
      p_scor_controller.tap = true,
      p_scor_controller.scrollRecord = this.getViewItems()[index].element.getY();```

      Delete
    2. I have a list of people that when I click on a personage it displays its coordinates.
      I want me when I return in the person of the list, the scroll is until the person I click previously

      Delete
  3. Now, is "this" a data view? I think there is a problem in scope.

    ReplyDelete
    Replies
    1. you have idea what i need to do

      Delete
    2. Check here[1]. There is a function "scrollToSelectedItem" and it is working.


      [1] https://github.com/Raxa/doctorsnearme/blob/master/app/view/ContactList.js

      Delete
    3. you know why my list.getItemMap() function return Array with 0 element when my list have 13 element

      Delete
  4. Hey buddy!! What amazing and useful information you are sharing here, thanks for sharing. I would love to share this information on mine post also so that the visitors of my blog also get a chance to become familiar with this information.

    Sencha Touch Development Company
    Hire Sencha Touch Developer

    ReplyDelete

  5. Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles Nodejs training

    ReplyDelete