PDA

View Full Version : [CLOSED] RAZOR / JS component Ref question



OriCoder
Apr 12, 2013, 11:11 AM
Hi Guys

I am cracking on through my dynamic tab creation and now I have a wee reference question. I am adding



TempData["tabNumber"]


To my id's that I need to be unique but part of the code uses a javascript direct method to build and fire a url in this I was just saying



App.assetType.getDisplayValue()


Which worked fine but of course it wont now are the ID will be assetType1 , assetType2, etc, etc

I thought that using
Ext.getTextField('sStock' + tabnumber).getValue() might work as
Ext.getStore('OrderLegs') does the trick for stores. But just get errors

Not sure how I should reference these text fields etc.

Daniil
Apr 12, 2013, 11:26 AM
Hi @OriCoder,

There is the getCmp function.
http://docs.sencha.com/ext-js/4-2/#!/api/Ext-method-getCmp

Example

Ext.getCmp('sStock' + tabnumber).getValue()

OriCoder
Apr 12, 2013, 2:54 PM
douhhhh! should have thought of that using it all the time in the controller. Closed