[CLOSED] Get Reference to Grids ComponentColumn's Control in javascript

  1. #1

    [CLOSED] Get Reference to Grids ComponentColumn's Control in javascript

    Hello,
    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 )
    	.TabConfig
    	(
    		X.Button()
    			.ToolTips 
    			(
    				this.Model.CreateToolTip ( "sstabFilters" , "Id_Filter", "Filter Criteria Tab" ) )    
    			) 
                .Store 
    			(
                    X.StoreFor<Linq.Entity.BrowserFilterSet> ( )
    					.AutoLoad ( true )
                        .PageSize ( 20 )
                        .DataSource ( Model.BrowserFilterSet )
                        .Reader 
    					( 
    						reader => reader.Add ( X.JsonReader ( ) )
                        )
                )
                .ColumnModel 
    			(
    				X.ComponentColumn ( )
    					.Editor(true)
    					.Text ( "Value" )
    					.ItemID ( "ValueComponentColumn")
    					.DataIndex ( "Operand2DisplayValue" )
    					.Flex ( 1 )
    					.Component 
    					(
                            X.TextField ( )
    							.ItemID("ValueColumnOperand2Display")
    							.EnableKeyEvents ( true )
    							.Listeners 
    							(
    								l =>
    								{
    									l.SpecialKey.Fn = "FilterKeyHandling";
    									l.KeyUp.Fn = "FilterValueHandling";
    									l.Change.Fn = "FilterValueHandling";
    									l.Change.Delay = 10;
    								}
    							)
    					)
    					.Listeners(l => l.BeforeBind.Handler = "FixedFilter(e);")
    			)
    	)
    Last edited by edip; Jun 22, 2016 at 10:07 PM.
  2. #2
    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.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: May 12, 2016, 12:18 PM
  2. Replies: 1
    Last Post: Mar 24, 2015, 12:40 PM
  3. Replies: 0
    Last Post: Jan 30, 2014, 3:24 PM
  4. How to reference External Javascript Files????
    By healingnations in forum 1.x Help
    Replies: 1
    Last Post: Dec 07, 2011, 3:45 AM
  5. Two grids in a user control
    By KHafeez in forum 1.x Help
    Replies: 4
    Last Post: Jan 29, 2010, 7:36 AM

Posting Permissions