View Full Version : [CLOSED] Get Reference to Grids ComponentColumn's Control in javascript

Jun 22, 2016, 9:15 PM
I have an Ext.Net.GridPanel which contains an Ext.Net.ComponentColumn which contains an Ext.Net.TextField.

You will notice that in the View, the Ext.Net.TextField has a listener for the Change event which does not take any parameters ( such as "this" ) as follows...

l.Change.Fn = "FilterValueHandling";

In the Javascript, the signature of "FilterValueHandling" has an argument which takes a reference to the Ext.Net.TextField and looks like this...

function FilterValueHandling ( reference )

From another Javascript method, I need to call "FilterValueHandling" to update. I make this call with a reference to the "TextField" object and it does not work, but it works fine when i type in the TextField and it fires the event.

How can i get the proper reference to pass to the "FilterValueHandling" function? The sample code for the view is below...

X.GridPanel ( )
.ItemID ( "TabFilterCriteria" )
.SortableColumns ( false )
.EnableColumnHide ( false )
.EnableColumnMove ( false )
this.Model.CreateToolTip ( "sstabFilters" , "Id_Filter", "Filter Criteria Tab" ) )
X.StoreFor<Linq.Entity.BrowserFilterSet> ( )
.AutoLoad ( true )
.PageSize ( 20 )
.DataSource ( Model.BrowserFilterSet )
reader => reader.Add ( X.JsonReader ( ) )
X.ComponentColumn ( )
.Text ( "Value" )
.ItemID ( "ValueComponentColumn")
.DataIndex ( "Operand2DisplayValue" )
.Flex ( 1 )
X.TextField ( )
.EnableKeyEvents ( true )
l =>
l.SpecialKey.Fn = "FilterKeyHandling";
l.KeyUp.Fn = "FilterValueHandling";
l.Change.Fn = "FilterValueHandling";
l.Change.Delay = 10;
.Listeners(l => l.BeforeBind.Handler = "FixedFilter(e);")

Jun 23, 2016, 10:03 PM
Hello Emidio!

Sorry, I am not sure how to help you in this. Can you provide a full yet simplified sample with the failing method?

Wild guess: the outside method is being called then the textfield is 'dismissed' from the editor, so it does not apply for the field being edited.

Remember in the grid panel editor a same text field moves around (at row level) the edited cell. In other words, when editing fields in a same column, the same text field component is moved around each cell when editing. Binds when start editing, unbinds when editing is done. And this might just be the source of confusion with your auxiliary code.

Again, can't say for sure unless we can reproduce the issue in our side.