Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: MVC Sample App

  1. #11
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    Quote Originally Posted by stevwinata View Post
    Code:
    onGuestListSearch: function(element, e) {
            // do the search here - f.e. an AJAX call to your server, etc.
            var searchPattern =  this.getGuestListSearchField().getValue();
    }
    above code show me how to get value from a component. that's right? i tried on a textfield (any textfield in view) and give me error "cannot found method". if it can, how doing it right in your pattern?
    the method getGuestListSearchField() is created by Touch based on the ref(erence) "guestListSearchField" at the start of the controller (in the refs section).

    When you need to access other fields you will have to write a reference to that field. F.e. if you have a textfield in your form that has the property name: 'guestName' then you could write:
    Code:
    refs: {
        ...
        guestListSearchField: 'guestlist searchfield',
        guestFormGuestNameField: 'guestform textfield[name=guestName]',
        ...
    },
    This will let Touch to create a getter (and a setter) for you. So when you need to access the field you could write
    Code:
    var name = this.getGuestFormGuestNameField().getValue();
    This is ok to access single fields. But when it is about to access a whole form you better use something like this
    Code:
    var formValues = this.getGuestForm().getValues();
    This will retrieve all NAMED field values (=fields that have the attribute NAME set).

  2. #12
    Sencha User
    Join Date
    Mar 2014
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Thank you For sharing....

  3. #13
    Sencha User
    Join Date
    Apr 2014
    Posts
    1
    Vote Rating
    1
      1  

    Default

    The updated example can be found at https://dl.dropboxusercontent.com/u/...2013-11-04.zip. The original post has the name of the new version but links to the old version.

  4. #14
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    Quote Originally Posted by dconde View Post
    The updated example can be found at https://dl.dropboxusercontent.com/u/...2013-11-04.zip. The original post has the name of the new version but links to the old version.
    fixed! thanks for bringing this up!!

  5. #15
    Sencha User
    Join Date
    Aug 2014
    Posts
    5
    Vote Rating
    0
      0  

    Default

    Hi Hefti, This example is really useful, thanks a lot for such a nice example

Page 2 of 2 FirstFirst 12

Posting Permissions

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