EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: dailyblog on December 16, 2012, 06:54:49 PM



Title: events of datagrid editors
Post by: dailyblog on December 16, 2012, 06:54:49 PM
i got this demo at  http://www.jeasyui.com/tutorial/datagrid/datagrid15.php  .
how to bind event to editors of combogrid ,datebox & combobox except  that of text & numberbox.
my code is as below ,but it does not work.
Code:
            onClickRow:function(rowindex,rowdata){
               
                if(lastindex!=rowindex){
                    $("#grid").datagrid("endEdit",lastindex);
                    $("#grid").datagrid("beginEdit",rowindex);
                    }
                    else
                    {$("#grid").datagrid("beginEdit",rowindex);}
                    lastindex=rowindex;
                   
                    var editors=$("#grid").datagrid("getEditors",rowindex);
                    e_mail=editors[0].target ;
                   
                    e_mail.bind('keydown',function(e){
                       alert('fffff');
                    });
the Filed type is combogrid.


Title: Re: events of datagrid editors
Post by: stworthy on December 16, 2012, 09:06:16 PM
Try the following code to bind 'keydown' event for the text box of combo and its dependent components.
Code:
var editors=$("#grid").datagrid("getEditors",rowindex);
$(editors[0].target).combo('textbox').bind('keydown',function(){
  // ...
});


Title: Re: events of datagrid editors
Post by: dailyblog on December 16, 2012, 10:46:53 PM
thanks. it works ok now. :)