1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    0
    flyingace is on a distinguished road

      0  

    Default Answered: Get "Disclose" action without icon in list and with full list item as button

    Answered: Get "Disclose" action without icon in list and with full list item as button


    I have followed along with the Intro to List Component tutorial and constructed my list and detail pages following the examples presented there. However, rather than just having the icon act as a button, I would like the whole list item to be targetable, and I would like not to see the arrow icon at the right side of the item.

    Perhaps I am missing out on some sort of core concept about what it means to "disclose," or about how the disclose event works as opposed to the itemtap event. But I think would prefer to use itemtap. However simply setting onItemDisclosure: to false and changing disclose to itemtap in the controller seems not to work and causes errors.

    Any guidance would be appreciated.

    Thanks,

    David

  2. when you use disclosure, the event sends back certain arguements, and it doesnt matter what the names are in your functions arguements, it will send it back in a certain order.

    for the disclosure event, the record of the data is the second arguement, and in itemtap, it is the fourth arguement.
    to check the arguements, look at the event for the component, they state it there in order.
    so to fix this, you have to change your function into
    showDetail: function (list, index, item, record) or showDetail: function (a,b,c, record)
    just as long as record is the fourth arguement.

    hope this helps!

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,087
    Answers
    3503
    Vote Rating
    855
    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


    Why not just use the itemtap event then?
    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.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    0
    flyingace is on a distinguished road

      0  

    Default


    However simply setting onItemDisclosure: to false and changing disclose to itemtap in the controller seems not to work and causes errors.
    When I do swap out "disclose" for "itemtap" in the controller (shown below), the "record.fullName()" function below causes the error "Uncaught TypeError: Object X has no method 'fullName'." (fullName() simply concatenates a first name and a last name field. The function is defined in the model.) If I simply swap this for "title: record.birdName" I get no error but the detail page shows no data at all and has no title.

    From the controller:
    Code:
    config: {
    refs: {
    birdholder: 'birdholder'
    }, control: {
    'birdlist': {
    disclose: 'showDetail'
    }
    }
    }, showDetail: function (list, record) {
    this.getBirdholder().push({
    xtype: 'birddetail',
    title: record.fullName(),
    data: record.data
    })
    }
    In the docs the disclose and itemtap events seem to pass the same parameters, so I am confused as to why I cannot substitute one for the other.

    Thanks again for your help,

    David

  5. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Answers
    3
    Vote Rating
    0
    shivbhaw is on a distinguished road

      0  

    Default


    when you use disclosure, the event sends back certain arguements, and it doesnt matter what the names are in your functions arguements, it will send it back in a certain order.

    for the disclosure event, the record of the data is the second arguement, and in itemtap, it is the fourth arguement.
    to check the arguements, look at the event for the component, they state it there in order.
    so to fix this, you have to change your function into
    showDetail: function (list, index, item, record) or showDetail: function (a,b,c, record)
    just as long as record is the fourth arguement.

    hope this helps!

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    0
    flyingace is on a distinguished road

      0  

    Default


    the event sends back certain arguements, and it doesnt matter what the names are in your functions arguements, it will send it back in a certain order.
    Perhaps because I am somewhat new to JS & Sencha, this was something of a revelation to me. Thank you so much for this clarification!

Thread Participants: 2

Tags for this Thread