Search code examples
javascriptextjssencha-touchsencha-architect

Sencha find Row in Object


I have a object list. This object filling by json data. Example Json data:

{"id":2677,"name":"------------------","stockCode":"RM0001","groupId":200000,"price":0.0,"color":"LightCyan","type":3,"mustModGrpCount":0,"mustModGroups":"","order":0,"campCount":0,"populer":false},{"id":398,"name":"KUVER","stockCode":"URN0380","groupId":200021,"price":0.0,"color":"aliceblue","type":3,"mustModGrpCount":0,"mustModGroups":"","order":0,"campCount":0,"populer":false}

I need to access ------------------ element.

Tried this but doesnt work.

var b=NewMobile.globals.products.getByField('name','------------------');

Solution

  • Fixed :

    var key =NewMobile.globals.products.findExact("stockCode","RM0001");
            var prd = NewMobile.globals.products.getAt(key);