[ 2 posts ]

lou

  • Username: janwen
  • Joined: Mon Aug 31, 2009 10:02 pm
  • Posts: 161
  • Location: China
  • Twitter: loujianwen
  • GitHub: janwen
  • Gists: janwen
  • IRC: janwen
  • Offline
  • Profile

datatable textbox get focus

Post Posted: Thu Nov 25, 2010 5:27 pm
+0-
I use the build-in formatter:textbox in my datatable;I want the input element at first row have focus when the page first load,but i can not get the input element of the cell,Here are the code:
Code:
//inital spot datatable
function loadDatable() {
   var spotColumn = [{
            key : "counter",
            label : "序号",
            formatter:"number",
         }, {
            key : "spot",
            label : "货位",
            width:150,
            formatter:"textbox"
         }, {
            key : "lcpn",
            label : "浪潮PN",
            width:150,
            formatter:"textbox"
         }]
   var spotDatasource = new YAHOO.util.DataSource([[1]]);
   spotDatasource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
   spotDatasource.responseSchema ={
      fields:["counter"]
   };
   var spotDatatable = new YAHOO.widget.DataTable("spotTable",spotColumn,spotDatasource);
     [b]  //get the input column field but
   log(spotDatatable.getRecord(0).getData("spot"));[/b]
}


how can i make the input element of a cell get focus,thanks

lou

  • Username: janwen
  • Joined: Mon Aug 31, 2009 10:02 pm
  • Posts: 161
  • Location: China
  • Twitter: loujianwen
  • GitHub: janwen
  • Gists: janwen
  • IRC: janwen
  • Offline
  • Profile

Re: datatable textbox get focus

Post Posted: Thu Nov 25, 2010 9:56 pm
+0-
I now get the way to make the input element of td get focus;
but there is another issue:
when a input of a cell gets value from code scanner,i set the next input at the same row get focus,but there is no event listener like valuechange for textinput,could you give me some idea?'
thanks
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum