Sencha Touch - Get Record on Change Event

I am trying to migrate some work on Ext JS to Sencha Touch.

I implemented some stuff using Ext JS's select event and I thought of implementing them in Sencha Touch. Since Touch didn't have a select event, I tried using change event. But then, I am stuck in a position where I might need data from the record

It would be great if there is a workaround for this.

Here is some code to make things clear:

// Ext JS Code
select : function(combo, record, index){
     Id = record.data.Id;
     Name = record.data.Name;
}

//Touch Code
change: function(combo, value){
     Id = value;
}

Here record.data is a JSON object. So basically, I want to traverse back to record to find the Name. Since the value property has Id, I am good there. Also, I am using Ext JS 3.4 and Touch 1.1 (if that would help).

Answers


It can be something like this.

//Touch Code
change: function(combo, value) {
    var rec = combo.store.findRecord('Id', value);
    Id = rec.get('Id'); // or Id = value
    Name = rec.get('Name');
}

Need Your Help

preg_replace html tags

php regex preg-replace

I would like to delete all html tags (including their attributes such as class, src, id, etc.) on a string but I would like to retain <ul>,<li> and <br /> tags. How will I accompl...

how can i connect between two select tag

javascript jquery html select

hi i have a select tag and i need if i click on any option from my first select.=====>i will get his attribute for it in the second select

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.