Results 1 to 2 of 2

Thread: triggerfield in grid

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    38
    Answers
    1
    Vote Rating
    3
      0  

    Default triggerfield in grid

    Hi there!

    I hava a grid and one of its column's editor is triggerfield.

    Following is what I want to achieve.

    When I click the triggerbutton, a window contains a grid is created and I doubleclick one row of the grid ,the value is put into the cell in which is the triggerfield.

    But my problem is when I double click the grid in the window,the cell whose editor is triggerfield don't has the value I wish it had.


    here is the eidtor
    Code:
    editor : {
       xtype : 'triggerfield',
       triggerCls : 'x-form-search-trigger',
       onTriggerClick : function(event){
          this.fireEvent('ontriggerclick',this,event);
       }
    }
    in the controller i detect the 'ontriggerclick' event
    Code:
    'triggerfield' : {
       'ontriggerclick' : this.triggerClick
    }
    now is the triggerClick function response to the event
    Code:
    triggerClick : function(field){
    		var me=this;
    		var openwindow=Ext.create('Ext.ux.OpenWindow',{});
    		var windowname;
    		var arg1;
    		var arg2;
    		var arg3;
    		var arg4;
    		var arg5;
    		var arg6;
    		var arg7;
    		var arg8;
    		var arg9;
    		if(me.flag=='query'){
    			windowname='q_gem';
    			arg1='';
    			arg2='';
    			arg3='';
    			arg4='';
    			arg5='';
    			arg6='';
    			arg7='';
    			arg8='';
    			arg9='';
    			openwindow.openWindow(field,'SYSTEM',windowname,'c',arg1,a  rg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
    		}
    		else{
    			windowname='q_gem';
    			arg1='';
    			arg2='';
    			arg3='';
    			arg4='';
    			arg5='';
    			arg6='';
    			arg7='';
    			arg8='';
    			arg9='';
    			openwindow.openWindow(field,'SYSTEM',windowname,'i',arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);//field is a object(triggerfield),and the other params has nothing to do with my problem
    		}
    }
    openWindow is a class I defined ,which creates a window and a grid contains data in it.When I double click the grid the data whill be set in the triggerfield.

    Any help would be appreciated.
    Thank you so much for viewing my post!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    I would make an extension for this and simple use that xtype
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •