2011-10-10 10 views
1

は私がのためにクリックし、リストのためのpatientIdを取得したい私は.on機能でHTMLDivElement煎茶タッチHTMLDivElementで

wplStore.load(); 
var itemTpl = new Ext.XTemplate('<div class="wpllist">'+ 
       '<div><div class="wpl_txt_line1">{patientInfo}&nbsp;</div> <div class="wpl_txt_line1_right" style="float:right"></div></div>'+ 
       '<div style="clear:both"><div id="patientId" class="wpl_txt_line2_left">{patientId}</div> <div class="wpl_txt_line2_right">{checkInTime}</div></div>'+ 
       '</div>'); 

this.wplPatList = new Ext.List({ 
      id: 'wPatList', 
      store: wplStore, 
      itemTpl: itemTpl, 
      height: 370,    
      indexBar: false 
     }); 
     this.wplPatList.on('itemtap', function (view, item, event) { 
     alert(event.innerHTML + 'event'); 
      controller.showPatHisPanel(item); 
     }); 

から特定のdiv id結果を取得するのに役立ちます。これを得る方法?私を助けてください。イベントで

は、オブジェクトHTMLDivElementように私は私がPAT-3407ことを得ることができますどのようにこのことから、結果に

<div class="x-list-item-body"><div class="wpllist"><div><div class="wpl_txt_line1">Dinesh (Male, 9)&nbsp;</div> <div class="wpl_txt_line1_right" style="float:right"> </div></div><div style="clear:both"><div id="patientId" class="wpl_txt_line2_left">PAT-3407</div> <div class="wpl_txt_line2_right">Wed Sep 14 2011 06:07:00 GMT+0530 (IST)</div></div></div></div> 

を取得していますevent.innerHTMLアラートを来ていますか?私を助けてください。

答えて

0

お店が正しくセットアップされている場合は、あなただけ行う必要があります:

this.wplPatList.on('itemtap', function (view, item, event) { 

    var record = wplStore.getAt(item); 
    controller.showPatHisPanel(record.data.patientId); 

}): 
+0

はあなたに感謝!私は結果を得ました – Shakthi

+0

いいです!この答えを解決策としてマークしてください。乾杯 – Luis

関連する問題