PDA

View Full Version : triggerfield in grid



panbayi
23 Jan 2013, 7:42 PM
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


editor : {
xtype : 'triggerfield',
triggerCls : 'x-form-search-trigger',
onTriggerClick : function(event){
this.fireEvent('ontriggerclick',this,event);
}
}

in the controller i detect the 'ontriggerclick' event


'triggerfield' : {
'ontriggerclick' : this.triggerClick
}

now is the triggerClick function response to the event


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!

mitchellsimoens
28 Jan 2013, 12:40 PM
I would make an extension for this and simple use that xtype