Search code examples
.netext.net

How do I reference a field's content in Ext?


I have a field on a form like this one:

<ext:FieldSet ID="fdsDR" runat="server" Hidden="false" Width="520" AutoDataBind="true"
     Title='<%# Html.GetText("DR") %>' Collapsible="false">
     <Items>
          <ext:TriggerField ID="drName" runat="server" AutoDataBind="true"
                      FieldLabel='<%# Html.GetText("Name") %>' Width="340" Editable="false" LabelAlign="Top"
                      ItemCls="required">

I need to get the Name value that was inserted in the field and use it on a search filter on another field. How do I reference this content?

When I reference the ID "drName", I get "Ext.Net.TriggerField" on my search filter, so I've tried things like "drName.Value" and "drName.Content" but these give me empty strings, even when initiate the page with an example value on the drName field.


Solution

  • I figured it out. Using "Name.getValue()" to reference the name wasn't working because the field I was trying to send it to had "Mode="Value"", and it was receiving "Name.getValue()" as a string. After changing the field tag to "Mode="Raw"" I was able to receive the name input in the Name field. Kinda weird and counterintuitive, but this is what solved it.