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 Unanswered: 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,326
    Answers
    3884
    Vote Rating
    1297
      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!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •